login: permit change expired password wit PAM

Signed-off-by: Mario Abajo <marioabajo@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Mario Abajo 2021-05-06 02:10:47 +02:00 committed by Denys Vlasenko
parent ac4a0b3be7
commit 7de0ab21d9

View File

@ -442,6 +442,9 @@ int login_main(int argc UNUSED_PARAM, char **argv)
} }
/* check that the account is healthy */ /* check that the account is healthy */
pamret = pam_acct_mgmt(pamh, 0); pamret = pam_acct_mgmt(pamh, 0);
if (pamret == PAM_NEW_AUTHTOK_REQD) {
pamret = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
}
if (pamret != PAM_SUCCESS) { if (pamret != PAM_SUCCESS) {
failed_msg = "acct_mgmt"; failed_msg = "acct_mgmt";
goto pam_auth_failed; goto pam_auth_failed;