From 86a11183f78e2413a25af60db779f5edd23af562 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 12 Dec 2006 22:05:48 +0000 Subject: r20136: Fix #4290. Properly compute time to password expiration in message from pam_winbind. Thanks to Andrew Benham (This used to be commit 0d03f5137936546253a8b3334995f536f3621d57) --- source3/nsswitch/pam_winbind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') 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); } -- cgit