login: set PAM RHOST

Signed-off-by: Ryan Phillips <ryan@trolocsis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Ryan Phillips 2011-03-22 18:27:21 +01:00 committed by Denys Vlasenko
parent f922154f65
commit cf9074b54b

View File

@ -278,6 +278,14 @@ int login_main(int argc UNUSED_PARAM, char **argv)
failed_msg = "set_item(TTY)";
goto pam_auth_failed;
}
/* set RHOST */
if (opt_host) {
pamret = pam_set_item(pamh, PAM_RHOST, opt_host);
if (pamret != PAM_SUCCESS) {
failed_msg = "set_item(RHOST)";
goto pam_auth_failed;
}
}
pamret = pam_authenticate(pamh, 0);
if (pamret != PAM_SUCCESS) {
failed_msg = "authenticate";