From d432609c2a981fea3ad2e56b0fe0805de8bf4a2d Mon Sep 17 00:00:00 2001 From: mancha Date: Wed, 18 Feb 2015 17:32:12 +0000 Subject: [PATCH] sesman: fix so shadow accounts aren't incorrectly classified "inactive" as might happen if sp_max/sp_inact fields are empty or sp_lstchg=0. --- sesman/verify_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sesman/verify_user.c b/sesman/verify_user.c index 9dc77efc..0c7702b5 100644 --- a/sesman/verify_user.c +++ b/sesman/verify_user.c @@ -321,7 +321,10 @@ auth_account_disabled(struct spwd *stp) return 1; } - if (today >= (stp->sp_lstchg + stp->sp_max + stp->sp_inact)) + if ((stp->sp_max >= 0) && + (stp->sp_inact >= 0) && + (stp->sp_lstchg > 0) && + (today >= (stp->sp_lstchg + stp->sp_max + stp->sp_inact))) { return 1; }