diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-11-08 22:35:45 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-11-08 22:35:45 +0100 |
commit | 8c097ae84a500eae9c8e4ee21b7b3ea8f8d23259 (patch) | |
tree | f283fe472d136cdd65662e53d85cf252a7668e97 /sys/src/cmd/ssh.c | |
parent | 2a266430e3fbae4eac97182e04dbd91f275a1b3c (diff) |
ssh: handle unknown MSG_CHANNE_REQUEST messages
Diffstat (limited to 'sys/src/cmd/ssh.c')
-rw-r--r-- | sys/src/cmd/ssh.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/src/cmd/ssh.c b/sys/src/cmd/ssh.c index 0fce63315..92d8d27b5 100644 --- a/sys/src/cmd/ssh.c +++ b/sys/src/cmd/ssh.c @@ -966,8 +966,9 @@ dispatch(void) if(unpack(recv.r, recv.w-recv.r, "_sb", &s, &n, &b) < 0) break; if(debug) - fprint(2, "%s: ignoring global request %.*s\n", argv0, n, s); - if(b != 0) sendpkt("b", MSG_REQUEST_FAILURE); + fprint(2, "%s: global request: %.*s\n", argv0, n, s); + if(b != 0) + sendpkt("b", MSG_REQUEST_FAILURE); return; case MSG_DISCONNECT: if(unpack(recv.r, recv.w-recv.r, "_us", &c, &s, &n) < 0) @@ -1025,14 +1026,20 @@ dispatch(void) break; if(n != 0 && status == nil) status = smprint("%.*s", n, s); + c = MSG_CHANNEL_SUCCESS; } else if(n == 11 && memcmp(s, "exit-status", n) == 0){ if(unpack(p, recv.w-p, "u", &n) < 0) break; if(n != 0 && status == nil) status = smprint("%d", n); - } else if(debug) { - fprint(2, "%s: channel request: %.*s\n", argv0, n, s); + c = MSG_CHANNEL_SUCCESS; + } else { + if(debug) + fprint(2, "%s: channel request: %.*s\n", argv0, n, s); + c = MSG_CHANNEL_FAILURE; } + if(b != 0) + sendpkt("bu", c, recv.chan); return; case MSG_CHANNEL_EOF: recv.eof = 1; |