login: -f should not ask for password even with PAM

Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Sergey Naumov 2012-01-30 12:52:56 +01:00 committed by Denys Vlasenko
parent da2b2da6a7
commit 7eaa03709b

View File

@ -342,6 +342,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
goto pam_auth_failed;
}
}
if (!(opt & LOGIN_OPT_f)) {
pamret = pam_authenticate(pamh, 0);
if (pamret != PAM_SUCCESS) {
failed_msg = "authenticate";
@ -351,6 +352,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
* (in this case pamret == 7)
*/
}
}
/* check that the account is healthy */
pamret = pam_acct_mgmt(pamh, 0);
if (pamret != PAM_SUCCESS) {