add faster reset patch

This commit is contained in:
Peter Vrabec 2008-03-07 15:34:03 +00:00
parent b4dd99d31b
commit 34e80945bb

View File

@ -0,0 +1,19 @@
diff -up shadow-4.1.0/src/faillog.c.fasterReset shadow-4.1.0/src/faillog.c
--- shadow-4.1.0/src/faillog.c.fasterReset 2008-03-04 14:08:55.000000000 +0100
+++ shadow-4.1.0/src/faillog.c 2008-03-04 14:11:13.000000000 +0100
@@ -164,8 +164,13 @@ 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)