summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-04-02 22:00:06 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-13 14:57:13 +0200
commit3e7bd72f76b1b54831b5c1957e3d7d8fafe19663 (patch)
tree53648c1313282ecc0d030a79483b997cc39ea2c3 /src
parentf457080d62b41826cccddbf86661b4396e297d5f (diff)
downloadlibssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.tar.gz
libssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.tar.xz
libssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.zip
client: handle x11 channel open requests with callbacks
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/messages.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c
index 3701effb..bda622ff 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -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;