diff options
author | millert <millert@openbsd.org> | 1999-05-29 18:51:12 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 1999-05-29 18:51:12 +0000 |
commit | 4884e5aaba35537ab46f0edf0467295e29d43aec (patch) | |
tree | f8ad881a0a0c111681634aaca492c55109b0e1a0 /usr.sbin/vipw/vipw.c | |
parent | we no longer have a builtin.h file (diff) | |
download | wireguard-openbsd-4884e5aaba35537ab46f0edf0467295e29d43aec.tar.xz wireguard-openbsd-4884e5aaba35537ab46f0edf0467295e29d43aec.zip |
Check size as well as mtime when deciding whether or not the file
was changed during edit. Crontab patch from <andrew@untraceable.net>.
It may be better to simply do a real compare inline.
Diffstat (limited to 'usr.sbin/vipw/vipw.c')
-rw-r--r-- | usr.sbin/vipw/vipw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/vipw/vipw.c b/usr.sbin/vipw/vipw.c index 6308bc92299..dfcb22c6444 100644 --- a/usr.sbin/vipw/vipw.c +++ b/usr.sbin/vipw/vipw.c @@ -96,7 +96,8 @@ main(argc, argv) pw_edit(0, NULL); if (stat(_PATH_MASTERPASSWD_LOCK, &end)) pw_error(_PATH_MASTERPASSWD_LOCK, 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"); pw_error((char *)NULL, 0, 0); } |