Bugzilla – Attachment 2100 Details for
Bug 1943
[PATCH] ssh -W opens two connections when ControlPersist is enabled.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bz1943.diff
bz1943.diff (text/plain), 2.29 KB, created by
Damien Miller
on 2011-10-21 10:45:20 AEDT
(
hide
)
Description:
bz1943.diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2011-10-21 10:45:20 AEDT
Size:
2.29 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh.c,v >retrieving revision 1.367 >diff -u -p -r1.367 ssh.c >--- ssh.c 18 Oct 2011 05:15:28 -0000 1.367 >+++ ssh.c 20 Oct 2011 23:44:55 -0000 >@@ -1030,11 +1030,8 @@ client_setup_stdio_fwd(const char *host_ > } > > static void >-ssh_init_forwarding(void) >+ssh_init_stdio_forwarding(void) > { >- int success = 0; >- int i; >- > if (stdio_forward_host != NULL) { > if (!compat20) { > fatal("stdio forwarding require Protocol 2"); >@@ -1043,6 +1040,13 @@ ssh_init_forwarding(void) > stdio_forward_port)) > fatal("Failed to connect in stdio forward mode."); > } >+} >+ >+static void >+ssh_init_forwarding(void) >+{ >+ int success = 0; >+ int i; > > /* Initiate local TCP/IP port forwardings. */ > for (i = 0; i < options.num_local_forwards; i++) { >@@ -1234,6 +1238,7 @@ ssh_session(void) > } > > /* Initiate port forwardings. */ >+ ssh_init_stdio_forwarding(); > ssh_init_forwarding(); > > /* Execute a local command */ >@@ -1372,15 +1377,18 @@ ssh_session2(void) > int id = -1; > > /* XXX should be pre-session */ >+ if (!options.control_persist) >+ ssh_init_stdio_forwarding(); > ssh_init_forwarding(); > > /* Start listening for multiplex clients */ > muxserver_listen(); > > /* >- * If we are in control persist mode, then prepare to background >- * ourselves and have a foreground client attach as a control >- * slave. NB. we must save copies of the flags that we override for >+ * If we are in control persist mode and have a working mux listen >+ * socket, then prepare to background ourselves and have a foreground >+ * client attach as a control slave. >+ * NB. we must save copies of the flags that we override for > * the backgrounding, since we defer attachment of the slave until > * after the connection is fully established (in particular, > * async rfwd replies have been received for ExitOnForwardFailure). >@@ -1397,6 +1405,12 @@ ssh_session2(void) > need_controlpersist_detach = 1; > fork_after_authentication_flag = 1; > } >+ /* >+ * ControlPersist mux listen socket setup failed, attempt the >+ * stdio forward setup that we skipped earlier. >+ */ >+ if (options.control_persist && muxserver_sock == -1) >+ ssh_init_stdio_forwarding(); > > if (!no_shell_flag || (datafellows & SSH_BUG_DUMMYCHAN)) > id = ssh_session2_open();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1943
: 2100