]> granicus.if.org Git - shadow/commitdiff
* src/vipw.c: Likewise for the backup file.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 21 Mar 2009 19:28:02 +0000 (19:28 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 21 Mar 2009 19:28:02 +0000 (19:28 +0000)
ChangeLog
src/vipw.c

index ec308464026388f7a4141b44a4caaf219551f259..6035b14238cd8941a4e5c55d96ad555c39728d6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
        * src/useradd.c: Likewise for the default file, faillog, lastlog,
        and mail spool.
        * src/usermod.c: Likewise for the faillog and lastlog file.
+       * src/vipw.c: Likewise for the backup file.
 
 2009-03-15  Nicolas François  <nicolas.francois@centraliens.net>
 
index 037808aa79daaa319a5856a0d773bdb0d29dd0a9..f7d0e63f3402516fe465e5660ae31d7130325a65 100644 (file)
@@ -112,7 +112,8 @@ static int create_backup_file (FILE * fp, const char *backup, struct stat *sb)
                unlink (backup);
                return -1;
        }
-       if (fclose (bkfp) != 0) {
+       if (   (fsync (fileno (bkfp)) != 0)
+           || (fclose (bkfp) != 0)) {
                unlink (backup);
                return -1;
        }