mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
client: handle x11 channel open requests with callbacks
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
f457080d62
commit
3e7bd72f76
@@ -130,6 +130,19 @@ static int ssh_execute_server_callbacks(ssh_session session, ssh_message msg){
|
||||
ssh_message_reply_default(msg);
|
||||
}
|
||||
return SSH_OK;
|
||||
} else if (msg->channel_request_open.type == SSH_CHANNEL_X11){
|
||||
if(ssh_callbacks_exists(session->common.callbacks, channel_open_request_x11_function)){
|
||||
channel = session->common.callbacks->channel_open_request_x11_function (session,
|
||||
msg->channel_request_open.originator, msg->channel_request_open.originator_port,
|
||||
session->common.callbacks->userdata);
|
||||
if(channel != NULL) {
|
||||
rc = ssh_message_channel_request_open_reply_accept_channel(msg, channel);
|
||||
return SSH_OK;
|
||||
} else {
|
||||
ssh_message_reply_default(msg);
|
||||
}
|
||||
return SSH_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user