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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Wed Mar 5 00:10:27 UTC 2008


Author: nekral-guest
Date: 2008-03-05 00:10:25 +0000 (Wed, 05 Mar 2008)
New Revision: 1875

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/src/faillog.c
Log:
Only reset the entries of existing users with faillog -r (not all numeric
IDs starting from 0). Thanks to Peter Vrabec.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-03-04 23:53:00 UTC (rev 1874)
+++ upstream/trunk/ChangeLog	2008-03-05 00:10:25 UTC (rev 1875)
@@ -1,5 +1,11 @@
 2008-03-05  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* NEWS, src/faillog.c: Only reset the entries of existing users
+	with faillog -r (not all numeric IDs starting from 0). Thanks to
+	Peter Vrabec.
+
+2008-03-05  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/pwunconv.c: Fix typo. One "can't open" message is a "can't
 	lock".
 

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-03-04 23:53:00 UTC (rev 1874)
+++ upstream/trunk/NEWS	2008-03-05 00:10:25 UTC (rev 1875)
@@ -21,6 +21,9 @@
 - chage
   * Fix bug which forbid to set the aging information of an account with a
     passwd entry, but no shadow entry.
+- faillog
+  * faillog -r now only reset the entries of existing users. This makes
+    faillog faster.
 - gpasswd
   * Fix failures when the gshadow file is not present.
   * When a password is moved to the gshadow file, use "x" instead of "x"

Modified: upstream/trunk/src/faillog.c
===================================================================
--- upstream/trunk/src/faillog.c	2008-03-04 23:53:00 UTC (rev 1874)
+++ upstream/trunk/src/faillog.c	2008-03-05 00:10:25 UTC (rev 1875)
@@ -163,8 +163,14 @@
 
 	if (uflg)
 		reset_one (user);
-	else
-		for (uid = 0; reset_one (uid); uid++);
+	else {
+		struct passwd *pwent;
+
+		setpwent ();
+		while ( pwent = getpwent () ) {
+			reset_one (pwent->pw_uid);
+		}
+	}
 }
 
 static void print (void)




More information about the Pkg-shadow-commits mailing list