[ssh-add.c]
     ignore errors for nonexisting default keys in ssh-add,
     fixes http://bugzilla.mindrot.org/show_bug.cgi?id=158

Last patch was SUPPOSE to be:
   - stevesk@cvs.openbsd.org 2002/03/20 21:08:08
     [sshd.c]
     strerror() on chdir() fail; ok provos@

But it got co-mingled.  <sigh>  Flog me at will.
This commit is contained in:
Ben Lindstrom 2002-03-22 03:21:16 +00:00
parent 1ee9ec32a3
commit 58b391b1bd
2 changed files with 13 additions and 2 deletions

View File

@ -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 $

View File

@ -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 <openssl/evp.h>
@ -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)