From 7fca94edbe8ca9f879da9fdd2afd959c4180f4c7 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Sun, 18 Nov 2018 22:43:29 +0000 Subject: [PATCH] upstream: Fix inverted logic for redirecting ProxyCommand stderr to /dev/null. Fixes mosh in proxycommand mode that was broken by the previous ProxyCommand change that was reported by matthieu@. ok djm@ danj@ OpenBSD-Commit-ID: c6fc9641bc250221a0a81c6beb2e72d603f8add6 --- sshconnect.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sshconnect.c b/sshconnect.c index a700f467f..4862da5ed 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.307 2018/11/16 06:17:38 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.308 2018/11/18 22:43:29 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -163,7 +163,8 @@ ssh_proxy_fdpass_connect(struct ssh *ssh, const char *host, u_short port, * Stderr is left for non-ControlPersist connections is so * error messages may be printed on the user's terminal. */ - if (debug_flag || !options.control_persist) + if (!debug_flag && options.control_path != NULL && + options.control_persist) stderr_null(); argv[0] = shell; @@ -245,7 +246,8 @@ ssh_proxy_connect(struct ssh *ssh, const char *host, u_short port, * Stderr is left for non-ControlPersist connections is so * error messages may be printed on the user's terminal. */ - if (debug_flag || !options.control_persist) + if (!debug_flag && options.control_path != NULL && + options.control_persist) stderr_null(); argv[0] = shell;