[Bug 1988] ControlPersist causes stderr to be left open until the master connection times out

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Fri Jun 7 11:40:47 EST 2013


https://bugzilla.mindrot.org/show_bug.cgi?id=1988

Damien Miller <djm at mindrot.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #2299|ok?(djm at mindrot.org)        |ok+
              Flags|                            |

--- Comment #6 from Damien Miller <djm at mindrot.org> ---
Comment on attachment 2299
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2299
daemonize backgrounded mux master with controlpersist

>Index: ssh.c
>===================================================================
>RCS file: /cvs/src/usr.bin/ssh/ssh.c,v
>retrieving revision 1.378
>diff -u -p -r1.378 ssh.c
>--- ssh.c	17 May 2013 00:13:14 -0000	1.378
>+++ ssh.c	6 Jun 2013 01:51:58 -0000
>@@ -947,6 +947,8 @@ control_persist_detach(void)
> 		fatal("%s: fork: %s", __func__, strerror(errno));
> 	case 0:
> 		/* Child: master process continues mainloop */
>+		if (daemon(1, 0) == -1)
>+ 			fatal("Failed to daemonize control master");

I'd prefer this happen in the block after the switch statement, where
the fd cleanup already occurs.

Otherwise ok by me

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list