svn commit: samba r20136 - in branches: SAMBA_3_0/source/nsswitch
SAMBA_3_0_24/source/nsswitch
jmcd at samba.org
jmcd at samba.org
Tue Dec 12 22:05:49 GMT 2006
Author: jmcd
Date: 2006-12-12 22:05:48 +0000 (Tue, 12 Dec 2006)
New Revision: 20136
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20136
Log:
Fix #4290. Properly compute time to password expiration in message from
pam_winbind. Thanks to Andrew Benham <andrew.benham at thus.net>
Modified:
branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
branches/SAMBA_3_0_24/source/nsswitch/pam_winbind.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c 2006-12-12 21:47:56 UTC (rev 20135)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c 2006-12-12 22:05:48 UTC (rev 20136)
@@ -536,7 +536,8 @@
(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);
}
Modified: branches/SAMBA_3_0_24/source/nsswitch/pam_winbind.c
===================================================================
--- branches/SAMBA_3_0_24/source/nsswitch/pam_winbind.c 2006-12-12 21:47:56 UTC (rev 20135)
+++ branches/SAMBA_3_0_24/source/nsswitch/pam_winbind.c 2006-12-12 22:05:48 UTC (rev 20136)
@@ -536,7 +536,8 @@
(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);
}
More information about the samba-cvs
mailing list