summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2006-12-12 22:05:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:27 -0500
commit86a11183f78e2413a25af60db779f5edd23af562 (patch)
tree084d48d15a89753397ac060d625531598cba7e89 /source3
parent8b4669c3c512484d456f8e0a16e2fd8e7499b026 (diff)
downloadsamba-86a11183f78e2413a25af60db779f5edd23af562.tar.gz
samba-86a11183f78e2413a25af60db779f5edd23af562.tar.bz2
samba-86a11183f78e2413a25af60db779f5edd23af562.zip
r20136: Fix #4290. Properly compute time to password expiration in message from
pam_winbind. Thanks to Andrew Benham <andrew.benham@thus.net> (This used to be commit 0d03f5137936546253a8b3334995f536f3621d57)
Diffstat (limited to 'source3')
-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);
}