diff options
author | 1996-09-30 01:54:48 +0000 | |
---|---|---|
committer | 1996-09-30 01:54:48 +0000 | |
commit | cac52e072510f8aa70193bc06ae6e7d4ade3b200 (patch) | |
tree | d38793340114e9961aa26d33a60da0d15fe3a2bc | |
parent | removed md2.h (diff) | |
download | wireguard-openbsd-cac52e072510f8aa70193bc06ae6e7d4ade3b200.tar.xz wireguard-openbsd-cac52e072510f8aa70193bc06ae6e7d4ade3b200.zip |
If can't open temp file (and it doesn't already exist) give real error message.
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 562b4dc4a89..f48411e685b 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.3 1996/06/26 05:37:46 deraadt Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.4 1996/09/30 01:54:48 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ -static char rcsid[] = "$OpenBSD: local_passwd.c,v 1.3 1996/06/26 05:37:46 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: local_passwd.c,v 1.4 1996/09/30 01:54:48 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -77,8 +77,12 @@ local_passwd(uname) pw_init(); tfd = pw_lock(0); - if (tfd < 0) - errx(1, "the passwd file is busy."); + if (tfd < 0) { + if (errno == EEXIST) + errx(1, "the passwd file is busy."); + else + err(1, "can't open passwd temp file"); + } pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0); if (pfd < 0) pw_error(_PATH_MASTERPASSWD, 1, 1); |