mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-26 14:03:17 +00:00
lib/, src/: Drop 10000 as infinity
If password aging should not be performed, disable it properly. Just specifying a "long enough time" is not infinity. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
This commit is contained in:
parent
07594bf4d0
commit
1031f5a0fb
@ -82,13 +82,11 @@ int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
|
||||
|
||||
/*
|
||||
* The last and max fields must be present for an account
|
||||
* to have an expired password. A maximum of >10000 days
|
||||
* is considered to be infinite.
|
||||
* to have an expired password.
|
||||
*/
|
||||
|
||||
if ( (-1 == sp->sp_lstchg)
|
||||
|| (-1 == sp->sp_max)
|
||||
|| (sp->sp_max >= 10000)) {
|
||||
|| (-1 == sp->sp_max)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -286,7 +286,6 @@ static void list_fields (void)
|
||||
if (lstchgdate == 0) {
|
||||
(void) puts (_("password must be changed"));
|
||||
} else if ( (lstchgdate < 0)
|
||||
|| (maxdays >= 10000)
|
||||
|| (maxdays < 0)
|
||||
|| (LONG_MAX - lstchgdate < maxdays))
|
||||
{
|
||||
@ -306,7 +305,6 @@ static void list_fields (void)
|
||||
(void) puts (_("password must be changed"));
|
||||
} else if ( (lstchgdate < 0)
|
||||
|| (inactdays < 0)
|
||||
|| (maxdays >= 10000)
|
||||
|| (maxdays < 0)
|
||||
|| (LONG_MAX - inactdays < maxdays)
|
||||
|| (LONG_MAX - lstchgdate < maxdays + inactdays))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user