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:
Tobias Stoeckmann 2025-12-19 12:50:46 +00:00 committed by Alejandro Colomar
parent 07594bf4d0
commit 1031f5a0fb
2 changed files with 2 additions and 6 deletions

View File

@ -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;
}

View File

@ -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))