summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2005-09-13 23:40:07 +0000
committerdjm <djm@openbsd.org>2005-09-13 23:40:07 +0000
commit399d21a6cfe67883be6695b6e094d8fa8afa845e (patch)
tree9659a3b415cc9cd4d5df3df311dad5e9bea6b656 /usr.bin/ssh/ssh.c
parentmore Package/FatPackage common code: separate the proxy 'next' into two (diff)
downloadwireguard-openbsd-399d21a6cfe67883be6695b6e094d8fa8afa845e.tar.xz
wireguard-openbsd-399d21a6cfe67883be6695b6e094d8fa8afa845e.zip
ensure that stdio fds are attached; ok deraadt@
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 328bfda3eac..6e160bfda25 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.249 2005/07/30 01:26:16 djm Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.250 2005/09/13 23:40:07 djm Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -188,6 +188,9 @@ main(int ac, char **av)
struct servent *sp;
Forward fwd;
+ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
+ sanitise_stdfd();
+
/*
* Save the original real uid. It will be needed later (uid-swapping
* may clobber the real uid).