]> granicus.if.org Git - shadow/commitdiff
* libmisc/age.c: Return a specific message when sp_lstchg is null.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 5 Apr 2009 21:22:53 +0000 (21:22 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 5 Apr 2009 21:22:53 +0000 (21:22 +0000)
ChangeLog
libmisc/age.c

index 8aac68075e2237098fb176d34d4b00760043f6d9..60c48022d123abc0fc7c425fe60692adfd14de62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-04  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/age.c: Return a specific message when sp_lstchg is null.
+
 2009-03-21  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/sgetpwent.c, lib/sgetgrent.c: Use get_uid and get_gid to
index b036100c687d445792c7e4f20e8375c92df65db5..25463a67a1ed7232a06bb7781a79fbb4ecc41d37 100644 (file)
@@ -174,6 +174,12 @@ void agecheck (const struct passwd *pw, const struct spwd *sp)
            || (-1 == sp->sp_warn)) {
                return;
        }
+
+       if (0 == sp->sp_lstchg) {
+               (void) puts (_("You must change your password."));
+               return;
+       }
+
        remain = sp->sp_lstchg + sp->sp_max - now;
        if (remain <= sp->sp_warn) {
                remain /= DAY / SCALE;