X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/d3221cca2d803f842bd8cef2fc3c542d17b1be39..7b610012d5a0ff49adbebe5cad16c63fd02b4956:/ssh-add.c diff --git a/ssh-add.c b/ssh-add.c index f8db1eb3..084478d7 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-add.c,v 1.82 2006/07/09 15:15:11 stevesk Exp $ */ +/* $OpenBSD: ssh-add.c,v 1.91 2009/08/27 17:44:52 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -39,17 +39,25 @@ #include #include +#include #include +#include "openbsd-compat/openssl-compat.h" #include #include +#include +#include +#include +#include +#include +#include "xmalloc.h" #include "ssh.h" #include "rsa.h" #include "log.h" -#include "xmalloc.h" #include "key.h" +#include "buffer.h" #include "authfd.h" #include "authfile.h" #include "pathnames.h" @@ -135,7 +143,7 @@ add_file(AuthenticationConnection *ac, const char *filename) char msg[1024]; int fd, perms_ok, ret = -1; - if ((fd = open(filename, 0)) < 0) { + if ((fd = open(filename, O_RDONLY)) < 0) { perror(filename); return -1; } @@ -187,9 +195,6 @@ add_file(AuthenticationConnection *ac, const char *filename) if (confirm != 0) fprintf(stderr, "The user has to confirm each use of the key\n"); - } else if (ssh_add_identity(ac, private, comment)) { - fprintf(stderr, "Identity added: %s (%s)\n", filename, comment); - ret = 0; } else { fprintf(stderr, "Could not add identity: %s\n", filename); } @@ -302,7 +307,7 @@ do_file(AuthenticationConnection *ac, int deleting, char *file) static void usage(void) { - fprintf(stderr, "Usage: %s [options] [file ...]\n", __progname); + fprintf(stderr, "usage: %s [options] [file ...]\n", __progname); fprintf(stderr, "Options:\n"); fprintf(stderr, " -l List fingerprints of all identities.\n"); fprintf(stderr, " -L List public key parameters of all identities.\n");