From 82cf0ceea899d4c7a47bdec79eea6dc2a8576bc7 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 20 Dec 2000 13:34:48 +1100 Subject: - (djm) Workaround PAM inconsistencies between Solaris derived PAM code and Linux-PAM. Based on report and fix from Andrew Morgan --- auth2-pam.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'auth2-pam.c') diff --git a/auth2-pam.c b/auth2-pam.c index 8ffbc244..30e02101 100644 --- a/auth2-pam.c +++ b/auth2-pam.c @@ -1,5 +1,5 @@ #include "includes.h" -RCSID("$Id: auth2-pam.c,v 1.1 2000/12/03 00:51:51 djm Exp $"); +RCSID("$Id: auth2-pam.c,v 1.2 2000/12/20 02:34:49 djm Exp $"); #ifdef USE_PAM #include "ssh.h" @@ -70,8 +70,8 @@ do_conversation2(int num_msg, const struct pam_message **msg, packet_put_cstring(""); /* Instructions */ packet_put_cstring(""); /* Language */ for (i = 0, j = 0; i < num_msg; i++) { - if(((*msg)[i].msg_style == PAM_PROMPT_ECHO_ON) || - ((*msg)[i].msg_style == PAM_PROMPT_ECHO_OFF) || + if((PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_ON) || + (PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_OFF) || (i == num_msg - 1)) { j++; } @@ -79,7 +79,7 @@ do_conversation2(int num_msg, const struct pam_message **msg, packet_put_int(j); /* Number of prompts. */ context_pam2.num_expected = j; for (i = 0, j = 0; i < num_msg; i++) { - switch((*msg)[i].msg_style) { + switch(PAM_MSG_MEMBER(msg, i, msg_style)) { case PAM_PROMPT_ECHO_ON: echo = 1; break; @@ -91,18 +91,18 @@ do_conversation2(int num_msg, const struct pam_message **msg, break; } if(text) { - tmp = xmalloc(strlen(text) + strlen((*msg)[i].msg) + 2); + tmp = xmalloc(strlen(text) + strlen(PAM_MSG_MEMBER(msg, i, msg)) + 2); strcpy(tmp, text); strcat(tmp, "\n"); - strcat(tmp, (*msg)[i].msg); + strcat(tmp, PAM_MSG_MEMBER(msg, i, msg)); xfree(text); text = tmp; tmp = NULL; } else { - text = xstrdup((*msg)[i].msg); + text = xstrdup(PAM_MSG_MEMBER(msg, i, msg)); } - if(((*msg)[i].msg_style == PAM_PROMPT_ECHO_ON) || - ((*msg)[i].msg_style == PAM_PROMPT_ECHO_OFF) || + if((PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_ON) || + (PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_OFF) || (i == num_msg - 1)) { debug("sending prompt ssh-%d(pam-%d) = \"%s\"", j, i, text); -- cgit v1.2.3