]> granicus.if.org Git - shadow/commitdiff
* src/chage.c: When no shadow entry exist, thedefault sp_lstchg
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 5 Apr 2009 21:23:17 +0000 (21:23 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 5 Apr 2009 21:23:17 +0000 (21:23 +0000)
value should be -1 (no aging) rather than 0 (password must be
changed).
* src/chage.c: For password expiration and inactivity, indicate
that the password must be changed when sp_lstchg is null rather
than indicating that expiration and inactivity are not enabled.

ChangeLog
src/chage.c

index 44930bedb8fd70113d9f9a36e0e608bbb3ffcf9f..ddffb795b9f2b317a0b8fd8aae162e57c3d07167 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-04-04  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/chage.c: When no shadow entry exist, thedefault sp_lstchg
+       value should be -1 (no aging) rather than 0 (password must be
+       changed).
+       * src/chage.c: For password expiration and inactivity, indicate
+       that the password must be changed when sp_lstchg is null rather
+       than indicating that expiration and inactivity are not enabled.
+
 2009-04-04  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/isexpired.c: Document the isexpired return value.
index e7dad8b90f96371e6d1ec2d15c467507ceba432e..4579b80e707c781a405abac0ba63b692c32bfba0 100644 (file)
@@ -322,8 +322,11 @@ static void list_fields (void)
         * date plus the number of days the password is valid for.
         */
        (void) fputs (_("Password expires\t\t\t\t\t: "), stdout);
-       if ((lastday <= 0) || (maxdays >= (10000 * (DAY / SCALE)))
-           || (maxdays < 0)) {
+       if (lastday == 0) {
+               (void) puts (_("password must be changed"));
+       } else if (   (lastday < 0)
+                  || (maxdays >= (10000 * (DAY / SCALE)))
+                  || (maxdays < 0)) {
                (void) puts (_("never"));
        } else {
                expires = changed + maxdays * SCALE;
@@ -337,8 +340,12 @@ static void list_fields (void)
         * active will be disabled.
         */
        (void) fputs (_("Password inactive\t\t\t\t\t: "), stdout);
-       if ((lastday <= 0) || (inactdays < 0) ||
-           (maxdays >= (10000 * (DAY / SCALE))) || (maxdays < 0)) {
+       if (lastday == 0) {
+               (void) puts (_("password must be changed"));
+       } else if (   (lastday < 0)
+                  || (inactdays < 0)
+                  || (maxdays >= (10000 * (DAY / SCALE)))
+                  || (maxdays < 0)) {
                (void) puts (_("never"));
        } else {
                expires = changed + (maxdays + inactdays) * SCALE;
@@ -720,7 +727,7 @@ static void get_defaults (const struct spwd *sp)
                        mindays = -1;
                }
                if (!dflg) {
-                       lastday = 0;
+                       lastday = -1;
                }
                if (!Wflg) {
                        warndays = -1;