[Pkg-shadow-commits] r2574 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Mar 21 19:25:02 UTC 2009


Author: nekral-guest
Date: 2009-03-21 19:25:02 +0000 (Sat, 21 Mar 2009)
New Revision: 2574

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/usermod.c
Log:
	* src/usermod.c: Likewise for the faillog and lastlog file.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-03-21 19:18:06 UTC (rev 2573)
+++ upstream/trunk/ChangeLog	2009-03-21 19:25:02 UTC (rev 2574)
@@ -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 at centraliens.net>
 

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2009-03-21 19:18:06 UTC (rev 2573)
+++ upstream/trunk/src/usermod.c	2009-03-21 19:25:02 UTC (rev 2574)
@@ -1442,6 +1442,7 @@
 		/* 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 @@
 			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 @@
 		/* 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"),




More information about the Pkg-shadow-commits mailing list