Mailing List Archive

[PATCH] Fix control persist and stdio forward interaction
As reported earlier at

https://lists.mindrot.org/pipermail/openssh-unix-dev/2011-March/029441.html

there is some strange interaction between ControlPersist and ssh -W that
breaks things if you're using both. Specifically, ssh -W host:port with
ControlPersist enabled opens up two connections to host:port and sends
data from both back.

I think this is happening because channel_connect_stdio_fwd is being
called twice, once in client_setup_stdio_fwd, which is called from
ssh_init_forwarding, and once in process_mux_stdio_fwd, which is
called once the client process starts talking to the master process.

It looks like the way ControlPersist is implemented, the process forks,
with the child becoming the master process and the child making its
connection through that. Thus, it seems like a reasonable fix to not
call client_setup_stdio_fwd if need_controlpersist_detach is set, and
just allow it to happen later.

Does the attached patch look OK?

Thanks,
Ricky
Re: [PATCH] Fix control persist and stdio forward interaction [ In reply to ]
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