]> andersk Git - openssh.git/blobdiff - ssh-add.c
- stevesk@cvs.openbsd.org 2006/07/22 20:48:23
[openssh.git] / ssh-add.c
index ff85af0312bf50cb1183a5bd61010b0a85fd0fe2..f79ffb9156714d3f3a6c0f05c5ebd74bd574bfd5 100644 (file)
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.79 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.85 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
 
 #include <openssl/evp.h>
 
+#include <fcntl.h>
+#include <pwd.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "ssh.h"
 #include "rsa.h"
 #include "log.h"
@@ -132,7 +137,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;
        }
@@ -299,7 +304,7 @@ do_file(AuthenticationConnection *ac, int deleting, char *file)
 static void
 usage(void)
 {
-       fprintf(stderr, "Usage: %s [options]\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");
This page took 0.029064 seconds and 4 git commands to generate.