[openssh-commits] [openssh] 01/01: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Nov 1 11:09:06 AEDT 2017


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 939b30ba23848b572e15bf92f0f1a3d9cf3acc2b
Author: djm at openbsd.org@openbsd.org <djm at openbsd.org@openbsd.org>
Date:   Wed Nov 1 00:04:15 2017 +0000

    upstream commit
    
    fix broken stdout in ControlPersist mode, introduced by me in
    r1.467 and reported by Alf Schlichting
    
    OpenBSD-Commit-ID: 3750a16e02108fc25f747e4ebcedb7123c1ef509
---
 ssh.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/ssh.c b/ssh.c
index 9d5d9525..86262543 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.468 2017/10/27 01:57:06 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.469 2017/11/01 00:04:15 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1906,13 +1906,15 @@ ssh_session2(struct ssh *ssh, struct passwd *pw)
 	 * NB. this can only happen after LocalCommand has completed,
 	 * as it may want to write to stdout.
 	 */
-	if ((devnull = open(_PATH_DEVNULL, O_WRONLY)) == -1)
-		error("%s: open %s: %s", __func__,
-		    _PATH_DEVNULL, strerror(errno));
-	if (dup2(devnull, STDOUT_FILENO) < 0)
-		fatal("%s: dup2() stdout failed", __func__);
-	if (devnull > STDERR_FILENO)
-		close(devnull);
+	if (!need_controlpersist_detach) {
+		if ((devnull = open(_PATH_DEVNULL, O_WRONLY)) == -1)
+			error("%s: open %s: %s", __func__,
+			    _PATH_DEVNULL, strerror(errno));
+		if (dup2(devnull, STDOUT_FILENO) < 0)
+			fatal("%s: dup2() stdout failed", __func__);
+		if (devnull > STDERR_FILENO)
+			close(devnull);
+	}
 
 	/*
 	 * If requested and we are not interested in replies to remote

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list