blob: 42855c89d30f87bd01652c6a57a301dbbd001f69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
From 6f195b64890e08d3fbbbb792f45a7d94d641c914 Mon Sep 17 00:00:00 2001
From: mancha <mancha1 AT zoho DOT com>
Date: Wed, 18 Feb 2015
Subject: Fix inactive account determination
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(-)
--- a/sesman/verify_user.c
+++ b/sesman/verify_user.c
@@ -323,7 +323,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;
}
|