diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-05 20:18:36 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-05 20:18:36 +0000 |
commit | ab7a45ea0aed6467c339c8a97223989c662022df (patch) | |
tree | 52a2864873dddd56ac707b30a15ac6bed15797bc /usr.bin/chpass/edit.c | |
parent | 0b341a44b78008fbdd5a9fa3b0b887e56ccbc183 (diff) |
Fix temp file unlinking. We use atexit() since the libutil passwd
routines do their own exit.
Diffstat (limited to 'usr.bin/chpass/edit.c')
-rw-r--r-- | usr.bin/chpass/edit.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c index 43ee7ab6deb..6cc40675879 100644 --- a/usr.bin/chpass/edit.c +++ b/usr.bin/chpass/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.17 1999/11/28 13:08:17 ho Exp $ */ +/* $OpenBSD: edit.c,v 1.18 1999/12/05 20:18:35 millert Exp $ */ /* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: edit.c,v 1.17 1999/11/28 13:08:17 ho Exp $"; +static char rcsid[] = "$OpenBSD: edit.c,v 1.18 1999/12/05 20:18:35 millert Exp $"; #endif #endif /* not lint */ @@ -74,13 +74,10 @@ edit(tempname, pw) if (begin.st_mtime == end.st_mtime && begin.st_size == end.st_size) { warnx("no changes made"); - unlink(tempname); pw_error(NULL, 0, 0); } - if (verify(tempname, pw)) { - unlink(tempname); + if (verify(tempname, pw)) break; - } pw_prompt(); } } |