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

index 71db50c34c551f519be099b45a2370959a5458ff..ec308464026388f7a4141b44a4caaf219551f259 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
        ensures that the backup file is flushed to the storage medium.
        * src/useradd.c: Likewise for the default file, faillog, lastlog,
        and mail spool.
+       * src/usermod.c: Likewise for the faillog and lastlog file.
 
 2009-03-15  Nicolas François  <nicolas.francois@centraliens.net>
 
index 0162a95e80ee6ac1ee767cc506808ed96e8a1112..cb4d803a2902fab25ba2bd7f7ae40ec459e26cac 100644 (file)
@@ -1442,6 +1442,7 @@ static void update_lastlog (void)
                /* Copy the old entry to its new location */
                if (   (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
                    || (write (fd, &ll, sizeof ll) != (ssize_t) sizeof ll)
+                   || (fsync (fd) != 0)
                    || (close (fd) != 0)) {
                        fprintf (stderr,
                                 _("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"),
@@ -1458,6 +1459,7 @@ static void update_lastlog (void)
                        memzero (&ll, sizeof (ll));
                        if (   (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
                            || (write (fd, &ll, sizeof ll) != (ssize_t) sizeof ll)
+                           || (fsync (fd) != 0)
                            || (close (fd) != 0)) {
                                fprintf (stderr,
                                         _("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"),
@@ -1501,6 +1503,7 @@ static void update_faillog (void)
                /* Copy the old entry to its new location */
                if (   (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
                    || (write (fd, &fl, sizeof fl) != (ssize_t) sizeof fl)
+                   || (fsync (fd) != 0)
                    || (close (fd) != 0)) {
                        fprintf (stderr,
                                 _("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),