[PATCH] Fix control persist and stdio forward interaction

Ricky Zhou ricky at rzhou.org
Thu Oct 13 20:24:51 EST 2011


On 2011-10-13 05:18:43 AM, Ricky Zhou wrote:
> Does the attached patch look OK?
Oops, looks like I forgot to attach the patch, so here it is.

Thanks,
Ricky
-------------- next part --------------
Index: ssh.c
===================================================================
RCS file: /cvs/openssh/ssh.c,v
retrieving revision 1.362
diff -u -r1.362 ssh.c
--- ssh.c	2 Oct 2011 07:59:03 -0000	1.362
+++ ssh.c	13 Oct 2011 09:16:27 -0000
@@ -1087,9 +1087,16 @@
 		if (!compat20) {
 			fatal("stdio forwarding require Protocol 2");
 		}
-		if (!client_setup_stdio_fwd(stdio_forward_host,
-		    stdio_forward_port))
-			fatal("Failed to connect in stdio forward mode.");
+
+		/*
+		 * If control persist is on, the stdio fwd is setup on the
+		 * master through the muxserver.
+		 */
+		if (!need_controlpersist_detach) {
+			if (!client_setup_stdio_fwd(stdio_forward_host,
+			    stdio_forward_port))
+				fatal("Failed to connect in stdio forward mode.");
+		}
 	}
 
 	/* Initiate local TCP/IP port forwardings. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20111013/ab62c998/attachment.bin>


More information about the openssh-unix-dev mailing list