]> granicus.if.org Git - shadow/commitdiff
Only reset the entries of existing users with faillog -r (not all numeric
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 5 Mar 2008 00:10:25 +0000 (00:10 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 5 Mar 2008 00:10:25 +0000 (00:10 +0000)
IDs starting from 0). Thanks to Peter Vrabec.

ChangeLog
NEWS
src/faillog.c

index 9d9a8a603313a4d8a766e543f27cf5326b4d562c..95ec9fd891739e8817bab62f8efede687768248b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-05  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * src/pwunconv.c: Fix typo. One "can't open" message is a "can't
diff --git a/NEWS b/NEWS
index a837bf38f3d2c1dd9b571915db4961ae18c82c20..fe68b97847e753e9af8d5b241b35bf09012cc432 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ shadow-4.1.0 -> shadow-4.1.1                                          UNRELEASED
 - 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"
index 91aa768da889a86a157b797a9d14f54e406fd22e..7ca935dd731dc8482453b24cf2a462b2108b2a36 100644 (file)
@@ -163,8 +163,14 @@ static void reset (void)
 
        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)