From f67403ba01e90e3efcaeccc2ad8e5a01d38b377b Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 5 Apr 2009 21:22:53 +0000 Subject: [PATCH] * libmisc/age.c: Return a specific message when sp_lstchg is null. --- ChangeLog | 4 ++++ libmisc/age.c | 6 ++++++ 2 files changed, 10 insertions(+) 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; -- 2.40.0