From 6adc6db21078d7bc40446eb1187ffa388b99743b Mon Sep 17 00:00:00 2001 From: Hakan Olsson Date: Sun, 28 Nov 1999 13:08:18 +0000 Subject: Check for size change as well as change in time. Scripted changes usually finish in less than a second. ('vipw' already does this.) --- usr.bin/chpass/edit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c index d4ab02416f7..43ee7ab6deb 100644 --- a/usr.bin/chpass/edit.c +++ b/usr.bin/chpass/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.16 1999/08/06 20:41:06 deraadt Exp $ */ +/* $OpenBSD: edit.c,v 1.17 1999/11/28 13:08:17 ho 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.16 1999/08/06 20:41:06 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: edit.c,v 1.17 1999/11/28 13:08:17 ho Exp $"; #endif #endif /* not lint */ @@ -71,7 +71,8 @@ edit(tempname, pw) pw_edit(1, tempname); if (lstat(tempname, &end) == -1 || S_ISLNK(end.st_mode)) pw_error(tempname, 1, 1); - if (begin.st_mtime == end.st_mtime) { + if (begin.st_mtime == end.st_mtime && + begin.st_size == end.st_size) { warnx("no changes made"); unlink(tempname); pw_error(NULL, 0, 0); -- cgit v1.2.3