1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

r21161: Another fix for pam_winbind: Move the entire pwd expiry handling into

the PAM_SUCCESS block.

Guenther
(This used to be commit f4a704745cb0bd2c5dc2a9b16619d8ee30fd7ba1)
This commit is contained in:
Günther Deschner 2007-02-05 18:11:41 +00:00 committed by Gerald (Jerry) Carter
parent 7440e4255c
commit 317d005142

View File

@ -1091,23 +1091,23 @@ static int winbind_auth_request(pam_handle_t * pamh,
PAM_WB_REMARK_CHECK_RESPONSE_RET(pamh, ctrl, response, "NT_STATUS_ACCESS_DENIED");
}
/* warn a user if the password is about to expire soon */
_pam_warn_password_expiry(pamh, ctrl, &response, &already_expired);
if (already_expired == True) {
_pam_log_debug(pamh, ctrl, LOG_DEBUG, "Password has expired "
"(Password was last set: %d, the policy says "
"it should expire here %d (now it's: %d)\n",
response.data.auth.info3.pass_last_set_time,
response.data.auth.info3.pass_last_set_time +
response.data.auth.policy.expire,
time(NULL));
return PAM_AUTHTOK_EXPIRED;
}
if (ret == PAM_SUCCESS) {
/* warn a user if the password is about to expire soon */
_pam_warn_password_expiry(pamh, ctrl, &response, &already_expired);
if (already_expired == True) {
_pam_log_debug(pamh, ctrl, LOG_DEBUG, "Password has expired "
"(Password was last set: %d, the policy says "
"it should expire here %d (now it's: %d))\n",
response.data.auth.info3.pass_last_set_time,
response.data.auth.info3.pass_last_set_time +
response.data.auth.policy.expire,
time(NULL));
return PAM_AUTHTOK_EXPIRED;
}
/* inform about logon type */
_pam_warn_logon_type(pamh, ctrl, user, response.data.auth.info3.user_flgs);