From: nekral-guest Date: Sun, 5 Apr 2009 21:22:53 +0000 (+0000) Subject: * libmisc/age.c: Return a specific message when sp_lstchg is null. X-Git-Tag: 4.1.3~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f67403ba01e90e3efcaeccc2ad8e5a01d38b377b;p=shadow * libmisc/age.c: Return a specific message when sp_lstchg is null. --- diff --git a/ChangeLog b/ChangeLog index 8aac6807..60c48022 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-04 Nicolas François + + * libmisc/age.c: Return a specific message when sp_lstchg is null. + 2009-03-21 Nicolas François * lib/sgetpwent.c, lib/sgetgrent.c: Use get_uid and get_gid to diff --git a/libmisc/age.c b/libmisc/age.c index b036100c..25463a67 100644 --- a/libmisc/age.c +++ b/libmisc/age.c @@ -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;