summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-09-21 07:29:09 +0000
committerdjm <djm@openbsd.org>2020-09-21 07:29:09 +0000
commita3b071095560470ecba34508f7e0aa951ea803f5 (patch)
tree8ba4437eaa021e2a9fe473248c79cef5bdfdd2d6 /usr.bin/ssh/ssh.c
parentmove a misplaced 'goto done;' so that all invalid uris are tested (diff)
downloadwireguard-openbsd-a3b071095560470ecba34508f7e0aa951ea803f5.tar.xz
wireguard-openbsd-a3b071095560470ecba34508f7e0aa951ea803f5.zip
close stdin when forking after authentication too; ok markus
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 342bbf5f59e..4da62450d3f 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.535 2020/09/20 23:31:46 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.536 2020/09/21 07:29:09 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1737,7 +1737,8 @@ fork_postauth(void)
_PATH_DEVNULL, strerror(errno));
else {
keep_stderr = log_is_on_stderr() && debug_flag;
- if (dup2(devnull, STDOUT_FILENO) == -1 ||
+ if (dup2(devnull, STDIN_FILENO) == -1 ||
+ dup2(devnull, STDOUT_FILENO) == -1 ||
(!keep_stderr && dup2(devnull, STDOUT_FILENO) == -1))
fatal("%s: dup2() stdio failed", __func__);
if (devnull > STDERR_FILENO)