From b9a07ad737c5b7e3bd763fc5870a1386613a771e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mr=C3=A1z?= Date: Fri, 17 Oct 2008 08:34:36 +0000 Subject: [PATCH] - fix compatibility with some servers (#466818) --- openssh-5.1p1-compat-sessions.patch | 49 +++++++++++++++++++++++++++++ openssh-5.1p1-redhat.patch | 8 ++--- openssh.spec | 7 ++++- 3 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 openssh-5.1p1-compat-sessions.patch diff --git a/openssh-5.1p1-compat-sessions.patch b/openssh-5.1p1-compat-sessions.patch new file mode 100644 index 0000000..c2ec55b --- /dev/null +++ b/openssh-5.1p1-compat-sessions.patch @@ -0,0 +1,49 @@ +diff -up openssh-5.1p1/nchan.c.compat-sessions openssh-5.1p1/nchan.c +--- openssh-5.1p1/nchan.c.compat-sessions 2008-07-02 14:32:43.000000000 +0200 ++++ openssh-5.1p1/nchan.c 2008-10-17 09:40:37.000000000 +0200 +@@ -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 -up openssh-5.1p1/compat.c.compat-sessions openssh-5.1p1/compat.c +--- openssh-5.1p1/compat.c.compat-sessions 2007-01-05 06:26:46.000000000 +0100 ++++ openssh-5.1p1/compat.c 2008-10-17 09:40:37.000000000 +0200 +@@ -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 -up openssh-5.1p1/compat.h.compat-sessions openssh-5.1p1/compat.h +--- openssh-5.1p1/compat.h.compat-sessions 2007-01-05 06:26:46.000000000 +0100 ++++ openssh-5.1p1/compat.h 2008-10-17 09:40:37.000000000 +0200 +@@ -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 -up openssh-5.1p1/ssh.c.compat-sessions openssh-5.1p1/ssh.c +--- openssh-5.1p1/ssh.c.compat-sessions 2008-09-12 11:03:32.000000000 +0200 ++++ openssh-5.1p1/ssh.c 2008-10-17 09:40:37.000000000 +0200 +@@ -1203,7 +1203,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"); diff --git a/openssh-5.1p1-redhat.patch b/openssh-5.1p1-redhat.patch index d1479cb..e1ac278 100644 --- a/openssh-5.1p1-redhat.patch +++ b/openssh-5.1p1-redhat.patch @@ -37,10 +37,10 @@ diff -up openssh-5.1p1/sshd_config.redhat openssh-5.1p1/sshd_config #UsePAM no +UsePAM yes + -+# Accept locale-related environment variables -+AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES -+AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT -+AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE ++# Accept locale-related environment variables ++AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES ++AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT ++AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE #AllowAgentForwarding yes #AllowTcpForwarding yes diff --git a/openssh.spec b/openssh.spec index bca7686..a6fc526 100644 --- a/openssh.spec +++ b/openssh.spec @@ -63,7 +63,7 @@ Summary: The OpenSSH implementation of SSH protocol versions 1 and 2 Name: openssh Version: 5.1p1 -Release: 2%{?dist}%{?rescue_rel} +Release: 3%{?dist}%{?rescue_rel} URL: http://www.openssh.com/portable.html #Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz #Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc @@ -97,6 +97,7 @@ Patch54: openssh-5.1p1-gssapi-role.patch Patch55: openssh-5.1p1-cloexec.patch Patch62: openssh-5.1p1-scp-manpage.patch Patch63: openssh-5.1p1-bannerlen.patch +Patch64: openssh-5.1p1-compat-sessions.patch License: BSD Group: Applications/Internet @@ -229,6 +230,7 @@ an X11 passphrase dialog for OpenSSH. %patch55 -p1 -b .cloexec %patch62 -p1 -b .manpage %patch63 -p1 -b .bannerlen +%patch64 -p1 -b .compat-sessions autoreconf @@ -480,6 +482,9 @@ fi %endif %changelog +* Fri Oct 17 2008 Tomas Mraz - 5.1p1-3 +- fix compatibility with some servers (#466818) + * Thu Jul 31 2008 Tomas Mraz - 5.1p1-2 - fixed zero length banner problem (#457326)