From: nekral-guest Date: Sat, 21 Mar 2009 19:28:02 +0000 (+0000) Subject: * src/vipw.c: Likewise for the backup file. X-Git-Tag: 4.1.3~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a65c2c9b18db42d4004cc939bc706e749cc6f5a4;p=shadow * src/vipw.c: Likewise for the backup file. --- diff --git a/ChangeLog b/ChangeLog index ec308464..6035b142 100644 --- 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 diff --git a/src/vipw.c b/src/vipw.c index 037808aa..f7d0e63f 100644 --- a/src/vipw.c +++ b/src/vipw.c @@ -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; }