summaryrefslogtreecommitdiff
path: root/auth2-pam.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-12-20 13:34:48 +1100
committerDamien Miller <djm@mindrot.org>2000-12-20 13:34:48 +1100
commit82cf0ceea899d4c7a47bdec79eea6dc2a8576bc7 (patch)
treef9011833137c0c5589ebe0b5fb45da9ddc069bca /auth2-pam.c
parent28bfc0da69166bc1afe33cfb1a61dadce01169e2 (diff)
- (djm) Workaround PAM inconsistencies between Solaris derived PAM code
and Linux-PAM. Based on report and fix from Andrew Morgan <morgan@transmeta.com>
Diffstat (limited to 'auth2-pam.c')
-rw-r--r--auth2-pam.c18
1 files changed, 9 insertions, 9 deletions
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);