From 0d03f5137936546253a8b3334995f536f3621d57 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 12 Dec 2006 22:05:48 +0000 Subject: [PATCH] r20136: Fix #4290. Properly compute time to password expiration in message from pam_winbind. Thanks to Andrew Benham --- source/nsswitch/pam_winbind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c index a61dceedce1..24e27cb8c69 100644 --- a/source/nsswitch/pam_winbind.c +++ b/source/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); } -- 2.11.4.GIT