From f063add71b66011cca8c313fe0c681b0f0e1b97f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 23 Nov 2008 13:19:32 +0000 Subject: * Backport from upstream CVS (Markus Friedl): - Only send eow and no-more-sessions requests to openssh 5 and newer; fixes interop problems with broken ssh v2 implementations (closes: #495917). --- compat.c | 3 ++- compat.h | 1 + debian/changelog | 4 ++++ nchan.c | 2 ++ ssh.c | 3 ++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/compat.c b/compat.c index bc1131581..8aa43f0f8 100644 --- a/compat.c +++ b/compat.c @@ -91,7 +91,8 @@ compat_datafellows(const char *version) "OpenSSH_3.1*", SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR}, { "OpenSSH_3.*", SSH_OLD_FORWARD_ADDR }, { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, - { "OpenSSH*", 0 }, + { "OpenSSH_4*", 0 }, + { "OpenSSH*", SSH_NEW_OPENSSH }, { "*MindTerm*", 0 }, { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| SSH_OLD_SESSIONID|SSH_BUG_DEBUG| diff --git a/compat.h b/compat.h index 4d8ebc908..5bd89ea73 100644 --- a/compat.h +++ b/compat.h @@ -57,6 +57,7 @@ #define SSH_BUG_FIRSTKEX 0x00800000 #define SSH_OLD_FORWARD_ADDR 0x01000000 #define SSH_BUG_RFWD_ADDR 0x02000000 +#define SSH_NEW_OPENSSH 0x04000000 void enable_compat13(void); void enable_compat20(void); diff --git a/debian/changelog b/debian/changelog index 0066dfd58..7b05bd269 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ openssh (1:5.1p1-4) UNRELEASED; urgency=low * ssh-copy-id: Strip trailing colons from hostname (closes: #226172, LP: #249706; thanks to Karl Goetz for nudging this along; forwarded upstream as https://bugzilla.mindrot.org/show_bug.cgi?id=1530). + * Backport from upstream CVS (Markus Friedl): + - Only send eow and no-more-sessions requests to openssh 5 and newer; + fixes interop problems with broken ssh v2 implementations (closes: + #495917). -- Colin Watson Thu, 09 Oct 2008 12:52:34 +0100 diff --git a/nchan.c b/nchan.c index e0ebf43f1..d31c69b2f 100644 --- a/nchan.c +++ b/nchan.c @@ -387,6 +387,8 @@ chan_send_eow2(Channel *c) c->self); return; } + if (!(datafellows & SSH_NEW_OPENSSH)) + return; packet_start(SSH2_MSG_CHANNEL_REQUEST); packet_put_int(c->remote_id); packet_put_cstring("eow@openssh.com"); diff --git a/ssh.c b/ssh.c index e2e2ef498..2b55e6397 100644 --- a/ssh.c +++ b/ssh.c @@ -1205,7 +1205,8 @@ ssh_session2(void) id = ssh_session2_open(); /* If we don't expect to open a new session, then disallow it */ - if (options.control_master == SSHCTL_MASTER_NO) { + if (options.control_master == SSHCTL_MASTER_NO && + (datafellows & SSH_NEW_OPENSSH)) { debug("Requesting no-more-sessions@openssh.com"); packet_start(SSH2_MSG_GLOBAL_REQUEST); packet_put_cstring("no-more-sessions@openssh.com"); -- cgit v1.2.3