2.9p2 behaves different from 2.5.2p2 on tunneling issue

Corinna Vinschen vinschen at redhat.com
Tue Sep 18 21:42:30 EST 2001


On Tue, Sep 18, 2001 at 11:55:24AM +0200, Markus Friedl wrote:
> On Tue, Sep 18, 2001 at 11:01:14AM +0200, Corinna Vinschen wrote:
> > It seems to be necessary with old servers, isn't it?
> 
> it's only necessary if the connection should stay open :)
> 
> > Is there a way in 2.9 to open a session anyway with -N so that
> > the server doesn't close the connection?
> 
> i think all you need to do is
> 	ssh_session2() should call ssh_session2_command()
> 	for old servers even if no_shell_flag is set
> 
> 	ssh_session2_command should not register a callback
> 	in this case.
> 
> can you try this?

It works. Thanks!

However, I don't know which servers are all so called `old servers'
with respect to that behaviour.  So in the following patch to compat.c
the flags are more or less a guess.  Could you check if they are ok?

Again, thanks for the hint which allowed me to create that patch.

Corinna

Index: compat.c
===================================================================
RCS file: /cvs/openssh_cvs/compat.c,v
retrieving revision 1.51
diff -u -p -r1.51 compat.c
--- compat.c	2001/09/18 05:55:10	1.51
+++ compat.c	2001/09/18 11:45:18
@@ -69,42 +69,49 @@ compat_datafellows(const char *version)
 	} check[] = {
 		{ "^OpenSSH[-_]2\\.[012]",
 					SSH_OLD_SESSIONID|SSH_BUG_BANNER|
-					SSH_OLD_DHGEX|SSH_BUG_NOREKEY },
+					SSH_OLD_DHGEX|SSH_BUG_NOREKEY|
+					SSH_BUG_CLOSECONN },
 		{ "^OpenSSH_2\\.3\\.0", SSH_BUG_BANNER|SSH_BUG_BIGENDIANAES|
-					SSH_OLD_DHGEX|SSH_BUG_NOREKEY},
+					SSH_OLD_DHGEX|SSH_BUG_NOREKEY|
+					SSH_BUG_CLOSECONN },
 		{ "^OpenSSH_2\\.3\\.",  SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX|
-					SSH_BUG_NOREKEY},
+					SSH_BUG_NOREKEY|SSH_BUG_CLOSECONN },
 		{ "^OpenSSH_2\\.5\\.[01]p1",
 					SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX|
-					SSH_BUG_NOREKEY },
+					SSH_BUG_NOREKEY|SSH_BUG_CLOSECONN },
 		{ "^OpenSSH_2\\.5\\.[012]",
-					SSH_OLD_DHGEX|SSH_BUG_NOREKEY },
+					SSH_OLD_DHGEX|SSH_BUG_NOREKEY|
+					SSH_BUG_CLOSECONN },
 		{ "^OpenSSH_2\\.5\\.3",
-					SSH_BUG_NOREKEY },
+					SSH_BUG_NOREKEY|SSH_BUG_CLOSECONN },
 		{ "^OpenSSH",		0 },
 		{ "MindTerm",		0 },
 		{ "^2\\.1\\.0",		SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
 					SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
-					SSH_BUG_RSASIGMD5|SSH_BUG_HBSERVICE },
+					SSH_BUG_RSASIGMD5|SSH_BUG_HBSERVICE|
+					SSH_BUG_CLOSECONN },
 		{ "^2\\.1 ",		SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
 					SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
-					SSH_BUG_RSASIGMD5|SSH_BUG_HBSERVICE },
+					SSH_BUG_RSASIGMD5|SSH_BUG_HBSERVICE|
+					SSH_BUG_CLOSECONN },
 		{ "^2\\.0\\.1[3-9]",	SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
 					SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
 					SSH_BUG_PKSERVICE|SSH_BUG_X11FWD|
 					SSH_BUG_PKOK|SSH_BUG_RSASIGMD5|
-					SSH_BUG_HBSERVICE|SSH_BUG_OPENFAILURE },
+					SSH_BUG_HBSERVICE|SSH_BUG_OPENFAILURE|
+					SSH_BUG_CLOSECONN },
 		{ "^2\\.0\\.1[1-2]",	SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
 					SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
 					SSH_BUG_PKSERVICE|SSH_BUG_X11FWD|
 					SSH_BUG_PKAUTH|SSH_BUG_PKOK|
-					SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE },
+					SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE|
+					SSH_BUG_CLOSECONN },
 		{ "^2\\.0\\.",		SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
 					SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
 					SSH_BUG_PKSERVICE|SSH_BUG_X11FWD|
 					SSH_BUG_PKAUTH|SSH_BUG_PKOK|
 					SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE|
-					SSH_BUG_DERIVEKEY },
+					SSH_BUG_DERIVEKEY|SSH_BUG_CLOSECONN },
 		{ "^2\\.[23]\\.0",	SSH_BUG_HMAC|SSH_BUG_DEBUG|
 					SSH_BUG_RSASIGMD5 },
 		{ "^2\\.3\\.",		SSH_BUG_DEBUG|SSH_BUG_RSASIGMD5 },
Index: compat.h
===================================================================
RCS file: /cvs/openssh_cvs/compat.h,v
retrieving revision 1.26
diff -u -p -r1.26 compat.h
--- compat.h	2001/07/04 04:46:57	1.26
+++ compat.h	2001/09/18 11:45:18
@@ -50,6 +50,7 @@
 #define SSH_BUG_HBSERVICE	0x00010000
 #define SSH_BUG_OPENFAILURE	0x00020000
 #define SSH_BUG_DERIVEKEY	0x00040000
+#define SSH_BUG_CLOSECONN	0x00100000
 
 void     enable_compat13(void);
 void     enable_compat20(void);
Index: ssh.c
===================================================================
RCS file: /cvs/openssh_cvs/ssh.c,v
retrieving revision 1.116
diff -u -p -r1.116 ssh.c
--- ssh.c	2001/09/12 18:32:20	1.116
+++ ssh.c	2001/09/18 11:45:20
@@ -1163,7 +1163,8 @@ ssh_session2(void)
 	/* XXX should be pre-session */
 	ssh_init_forwarding();
 
-	id = no_shell_flag ? -1 : ssh_session2_command();
+	id = no_shell_flag && !(datafellows & SSH_BUG_CLOSECONN) ?
+		-1 : ssh_session2_command();
 
 	/* If requested, let ssh continue in the background. */
 	if (fork_after_authentication_flag)



More information about the openssh-unix-dev mailing list