* src/vipw.c: Likewise for the backup file.

This commit is contained in:
nekral-guest 2009-03-21 19:28:02 +00:00
parent 5331930716
commit a65c2c9b18
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* src/useradd.c: Likewise for the default file, faillog, lastlog, * src/useradd.c: Likewise for the default file, faillog, lastlog,
and mail spool. and mail spool.
* src/usermod.c: Likewise for the faillog and lastlog file. * 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> 2009-03-15 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -112,7 +112,8 @@ static int create_backup_file (FILE * fp, const char *backup, struct stat *sb)
unlink (backup); unlink (backup);
return -1; return -1;
} }
if (fclose (bkfp) != 0) { if ( (fsync (fileno (bkfp)) != 0)
|| (fclose (bkfp) != 0)) {
unlink (backup); unlink (backup);
return -1; return -1;
} }