summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-09-30 01:54:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-09-30 01:54:49 +0000
commit25eb1be7162c9c2d2f66735a96ecc81ed1f16708 (patch)
treebf19e2de269f4b2198f90273609cbbcade40af4b
parentc6bc73cffafe98381a96aa7d2dcaeb5f2b614094 (diff)
If can't open temp file (and it doesn't already exist) give real error message.
-rw-r--r--usr.bin/passwd/local_passwd.c12
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);