diff --git a/ChangeLog b/ChangeLog index 9d9a8a60..95ec9fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-05 Nicolas François + + * 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 * src/pwunconv.c: Fix typo. One "can't open" message is a "can't diff --git a/NEWS b/NEWS index a837bf38..fe68b978 100644 --- 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" diff --git a/src/faillog.c b/src/faillog.c index 91aa768d..7ca935dd 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -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)