]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/: Drop 10000 as infinity
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 19 Dec 2025 12:50:46 +0000 (12:50 +0000)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Fri, 19 Dec 2025 14:21:49 +0000 (15:21 +0100)
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>
lib/isexpired.c
src/chage.c

index b30dcdce834a1a2984982c53937fc736f1ac1e82..be137c7a873848f28628a05048a3979aa211dcfb 100644 (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;
        }
 
index 54f64eb092b944feda7d7d0628c072ba522ed547..419c172337591b65bc9c983741fbbd5569c610e9 100644 (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))