diff --git a/ChangeLog b/ChangeLog index 030ef5a61..307e20e14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -104,6 +104,9 @@ [servconf.c servconf.h ssh.h sshd.c] for unprivileged user, group do: pw=getpwnam(SSH_PRIVSEP_USER); do_setusercontext(pw). ok provos@ + - stevesk@cvs.openbsd.org 2002/03/20 21:08:08 + [sshd.c] + strerror() on chdir() fail; ok provos@ - markus@cvs.openbsd.org 2002/03/21 10:21:20 [ssh-add.c] ignore errors for nonexisting default keys in ssh-add, @@ -7954,4 +7957,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1955 2002/03/22 03:14:45 mouring Exp $ +$Id: ChangeLog,v 1.1956 2002/03/22 03:21:16 mouring Exp $ diff --git a/ssh-add.c b/ssh-add.c index 8ef9702f6..baf2b3de7 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.51 2002/03/19 10:49:35 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.52 2002/03/21 10:21:20 markus Exp $"); #include @@ -310,6 +310,8 @@ main(int argc, char **argv) if (argc == 0) { char buf[MAXPATHLEN]; struct passwd *pw; + struct stat st; + int count = 0; if ((pw = getpwuid(getuid())) == NULL) { fprintf(stderr, "No user found with uid %u\n", @@ -321,9 +323,15 @@ main(int argc, char **argv) for(i = 0; default_files[i]; i++) { snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, default_files[i]); + if (stat(buf, &st) < 0) + continue; if (do_file(ac, deleting, buf) == -1) ret = 1; + else + count++; } + if (count == 0) + ret = 1; } else { for(i = 0; i < argc; i++) { if (do_file(ac, deleting, argv[i]) == -1)