From: Tobias Stoeckmann Date: Fri, 19 Dec 2025 12:50:46 +0000 (+0000) Subject: lib/, src/: Drop 10000 as infinity X-Git-Tag: 4.19.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1031f5a0fb191f0766bb31ad95abaa2cac7853ea;p=thirdparty%2Fshadow.git 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 --- diff --git a/lib/isexpired.c b/lib/isexpired.c index b30dcdce8..be137c7a8 100644 --- a/lib/isexpired.c +++ b/lib/isexpired.c @@ -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; } diff --git a/src/chage.c b/src/chage.c index 54f64eb09..419c17233 100644 --- a/src/chage.c +++ b/src/chage.c @@ -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))