diff options
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/auth-pam.c b/auth-pam.c index 8425af1ea..7cf9cf5fc 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -624,6 +624,7 @@ sshpam_init(Authctxt *authctxt) | |||
624 | extern char *__progname; | 624 | extern char *__progname; |
625 | const char *pam_rhost, *pam_user, *user = authctxt->user; | 625 | const char *pam_rhost, *pam_user, *user = authctxt->user; |
626 | const char **ptr_pam_user = &pam_user; | 626 | const char **ptr_pam_user = &pam_user; |
627 | struct ssh *ssh = active_state; /* XXX */ | ||
627 | 628 | ||
628 | if (sshpam_handle != NULL) { | 629 | if (sshpam_handle != NULL) { |
629 | /* We already have a PAM context; check if the user matches */ | 630 | /* We already have a PAM context; check if the user matches */ |
@@ -644,7 +645,7 @@ sshpam_init(Authctxt *authctxt) | |||
644 | sshpam_handle = NULL; | 645 | sshpam_handle = NULL; |
645 | return (-1); | 646 | return (-1); |
646 | } | 647 | } |
647 | pam_rhost = get_remote_name_or_ip(utmp_len, options.use_dns); | 648 | pam_rhost = auth_get_canonical_hostname(ssh, options.use_dns); |
648 | debug("PAM: setting PAM_RHOST to \"%s\"", pam_rhost); | 649 | debug("PAM: setting PAM_RHOST to \"%s\"", pam_rhost); |
649 | sshpam_err = pam_set_item(sshpam_handle, PAM_RHOST, pam_rhost); | 650 | sshpam_err = pam_set_item(sshpam_handle, PAM_RHOST, pam_rhost); |
650 | if (sshpam_err != PAM_SUCCESS) { | 651 | if (sshpam_err != PAM_SUCCESS) { |
@@ -715,6 +716,7 @@ static int | |||
715 | sshpam_query(void *ctx, char **name, char **info, | 716 | sshpam_query(void *ctx, char **name, char **info, |
716 | u_int *num, char ***prompts, u_int **echo_on) | 717 | u_int *num, char ***prompts, u_int **echo_on) |
717 | { | 718 | { |
719 | struct ssh *ssh = active_state; /* XXX */ | ||
718 | Buffer buffer; | 720 | Buffer buffer; |
719 | struct pam_ctxt *ctxt = ctx; | 721 | struct pam_ctxt *ctxt = ctx; |
720 | size_t plen; | 722 | size_t plen; |
@@ -797,7 +799,7 @@ sshpam_query(void *ctx, char **name, char **info, | |||
797 | error("PAM: %s for %s%.100s from %.100s", msg, | 799 | error("PAM: %s for %s%.100s from %.100s", msg, |
798 | sshpam_authctxt->valid ? "" : "illegal user ", | 800 | sshpam_authctxt->valid ? "" : "illegal user ", |
799 | sshpam_authctxt->user, | 801 | sshpam_authctxt->user, |
800 | get_remote_name_or_ip(utmp_len, options.use_dns)); | 802 | auth_get_canonical_hostname(ssh, options.use_dns)); |
801 | /* FALLTHROUGH */ | 803 | /* FALLTHROUGH */ |
802 | default: | 804 | default: |
803 | *num = 0; | 805 | *num = 0; |