X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/f8cc766444eae9f2c631b10358a29ff1971871e6..823221b29186882ad56bfb9bf95c6b2dc86e8bbe:/ssh-add.c diff --git a/ssh-add.c b/ssh-add.c index a796647a..2b01e6f1 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.71 2005/03/10 22:01:06 deraadt Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.74 2005/11/12 18:37:59 deraadt Exp $"); #include @@ -145,7 +145,7 @@ add_file(AuthenticationConnection *ac, const char *filename) /* clear passphrase since it did not work */ clear_pass(); snprintf(msg, sizeof msg, "Enter passphrase for %.200s: ", - comment); + comment); for (;;) { pass = read_passphrase(msg, RP_ALLOW_STDIN); if (strcmp(pass, "") == 0) { @@ -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(); + __progname = ssh_get_progname(argv[0]); init_rng(); seed_rng(); @@ -321,7 +324,8 @@ main(int argc, char **argv) /* At first, get a connection to the authentication agent. */ ac = ssh_get_authentication_connection(); if (ac == NULL) { - fprintf(stderr, "Could not open a connection to your authentication agent.\n"); + fprintf(stderr, + "Could not open a connection to your authentication agent.\n"); exit(2); } while ((ch = getopt(argc, argv, "lLcdDxXe:s:t:")) != -1) {