summaryrefslogtreecommitdiff
path: root/source3/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/pam_winbind.c')
-rw-r--r--source3/nsswitch/pam_winbind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index a61dceedce..24e27cb8c6 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -536,7 +536,8 @@ static int winbind_auth_request(pam_handle_t * pamh,
(response.data.auth.policy.expire) &&
(response.data.auth.info3.pass_last_set_time + response.data.auth.policy.expire > time(NULL) ) ) {
- int days = response.data.auth.policy.expire / SECONDS_PER_DAY;
+ int days = (response.data.auth.info3.pass_last_set_time + response.data.auth.policy.expire -
+ time(NULL))/ SECONDS_PER_DAY;
if (days <= DAYS_TO_WARN_BEFORE_PWD_EXPIRES) {
_make_remark_format(pamh, PAM_TEXT_INFO, "Your password will expire in %d days", days);
}