summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authormancha <mancha1@zoho.com>2015-02-18 17:32:12 +0000
committermancha <mancha1@zoho.com>2015-02-18 17:32:12 +0000
commitd432609c2a981fea3ad2e56b0fe0805de8bf4a2d (patch)
treed60a525ef6ed47b074f6e5385e39baf8a17fea9b /sesman
parent9cd634007f05eeb8fc13b40f87c38060c1f99dfd (diff)
downloadxrdp-proprietary-d432609c2a981fea3ad2e56b0fe0805de8bf4a2d.tar.gz
xrdp-proprietary-d432609c2a981fea3ad2e56b0fe0805de8bf4a2d.zip
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.
Diffstat (limited to 'sesman')
-rw-r--r--sesman/verify_user.c5
1 files changed, 4 insertions, 1 deletions
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;
}