diff options
author | mancha <mancha1@zoho.com> | 2015-02-18 17:32:12 +0000 |
---|---|---|
committer | mancha <mancha1@zoho.com> | 2015-02-18 17:32:12 +0000 |
commit | d432609c2a981fea3ad2e56b0fe0805de8bf4a2d (patch) | |
tree | d60a525ef6ed47b074f6e5385e39baf8a17fea9b /sesman | |
parent | 9cd634007f05eeb8fc13b40f87c38060c1f99dfd (diff) | |
download | xrdp-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.c | 5 |
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; } |