changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: ssh: handle MSG_GOBAL_REQUEST

changeset 6875: 04ab30b6cf1c
parent 6874: 469fa1f309de
child 6876: 12f6b6fbac27
author: cinap_lenrek@felloff.net
date: Thu, 08 Nov 2018 22:00:07 +0100
files: sys/src/cmd/ssh.c
description: ssh: handle MSG_GOBAL_REQUEST

respond to MSG_GLOBAL_REQUEST with MSG_REQUEST_FAILURE
as stated by rfc4254 when server wants a reply.

failing todo so breaks some proprietary keep-alive schemes.
     1.1--- a/sys/src/cmd/ssh.c
     1.2+++ b/sys/src/cmd/ssh.c
     1.3@@ -961,7 +961,13 @@ dispatch(void)
     1.4 
     1.5 	switch(recv.r[0]){
     1.6 	case MSG_IGNORE:
     1.7+		return;
     1.8 	case MSG_GLOBAL_REQUEST:
     1.9+		if(unpack(recv.r, recv.w-recv.r, "_sb", &s, &n, &b) < 0)
    1.10+			break;
    1.11+		if(debug)
    1.12+			fprint(2, "%s: ignoring global request %.*s\n", argv0, n, s);
    1.13+		if(b != 0) sendpkt("b", MSG_REQUEST_FAILURE);
    1.14 		return;
    1.15 	case MSG_DISCONNECT:
    1.16 		if(unpack(recv.r, recv.w-recv.r, "_us", &c, &s, &n) < 0)