summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-agent.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2005-09-13 23:40:08 +0000
committerDamien Miller <djm@cvs.openbsd.org>2005-09-13 23:40:08 +0000
commitf7ed8afaa32cf14a3921e1a6629a45030d317578 (patch)
treeaff976549515501dd8aecdd5af5558144fc815d4 /usr.bin/ssh/ssh-agent.c
parent1c0cfe866c6d27bcf2266c00206273572ea38d15 (diff)
ensure that stdio fds are attached; ok deraadt@
Diffstat (limited to 'usr.bin/ssh/ssh-agent.c')
-rw-r--r--usr.bin/ssh/ssh-agent.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 63b59a55d7b..912f3996bd9 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -35,7 +35,7 @@
#include "includes.h"
#include <sys/queue.h>
-RCSID("$OpenBSD: ssh-agent.c,v 1.122 2004/10/29 22:53:56 djm Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.123 2005/09/13 23:40:07 djm Exp $");
#include <openssl/evp.h>
#include <openssl/md5.h>
@@ -1001,6 +1001,9 @@ main(int ac, char **av)
pid_t pid;
char pidstrbuf[1 + 3 * sizeof pid];
+ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
+ sanitise_stdfd();
+
/* drop */
setegid(getgid());
setgid(getgid());