summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-06-06 08:21:14 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-06-06 08:21:14 +1000
commit0cca17fa1819d3a0ba06a6db41ab3eaa8d769587 (patch)
treef65e13ba122deabf8cadd968782dc1d2ce622617 /sshd.c
parent746e9067bd9b3501876e1c86f38f3c510a12f895 (diff)
- dtucker@cvs.openbsd.org 2013/06/05 02:27:50
[sshd.c] When running sshd -D, close stderr unless we have explicitly requesting logging to stderr. From james.hunt at ubuntu.com via bz#1976, djm's patch so, err, ok dtucker.
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index c0ba420a3..1306a62a7 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.402 2013/05/17 00:13:14 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.403 2013/06/05 02:27:50 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1024,7 +1024,9 @@ server_accept_inetd(int *sock_in, int *sock_out)
1024 if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 1024 if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
1025 dup2(fd, STDIN_FILENO); 1025 dup2(fd, STDIN_FILENO);
1026 dup2(fd, STDOUT_FILENO); 1026 dup2(fd, STDOUT_FILENO);
1027 if (fd > STDOUT_FILENO) 1027 if (!log_stderr)
1028 dup2(fd, STDERR_FILENO);
1029 if (fd > (log_stderr ? STDERR_FILENO : STDOUT_FILENO))
1028 close(fd); 1030 close(fd);
1029 } 1031 }
1030 debug("inetd sockets after dupping: %d, %d", *sock_in, *sock_out); 1032 debug("inetd sockets after dupping: %d, %d", *sock_in, *sock_out);