summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-add.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-add.c
parent1c0cfe866c6d27bcf2266c00206273572ea38d15 (diff)
ensure that stdio fds are attached; ok deraadt@
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r--usr.bin/ssh/ssh-add.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index 0347b3a94bd..a836e32dfa5 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.72 2005/07/17 07:17:55 djm Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.73 2005/09/13 23:40:07 djm Exp $");
#include <openssl/evp.h>
@@ -312,6 +312,9 @@ main(int argc, char **argv)
char *sc_reader_id = NULL;
int i, ch, deleting = 0, ret = 0;
+ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
+ sanitise_stdfd();
+
SSLeay_add_all_algorithms();
/* At first, get a connection to the authentication agent. */