diff options
Diffstat (limited to 'auth2-pam.c')
-rw-r--r-- | auth2-pam.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/auth2-pam.c b/auth2-pam.c index 8ffbc244c..30e02101e 100644 --- a/auth2-pam.c +++ b/auth2-pam.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "includes.h" | 1 | #include "includes.h" |
2 | RCSID("$Id: auth2-pam.c,v 1.1 2000/12/03 00:51:51 djm Exp $"); | 2 | RCSID("$Id: auth2-pam.c,v 1.2 2000/12/20 02:34:49 djm Exp $"); |
3 | 3 | ||
4 | #ifdef USE_PAM | 4 | #ifdef USE_PAM |
5 | #include "ssh.h" | 5 | #include "ssh.h" |
@@ -70,8 +70,8 @@ do_conversation2(int num_msg, const struct pam_message **msg, | |||
70 | packet_put_cstring(""); /* Instructions */ | 70 | packet_put_cstring(""); /* Instructions */ |
71 | packet_put_cstring(""); /* Language */ | 71 | packet_put_cstring(""); /* Language */ |
72 | for (i = 0, j = 0; i < num_msg; i++) { | 72 | for (i = 0, j = 0; i < num_msg; i++) { |
73 | if(((*msg)[i].msg_style == PAM_PROMPT_ECHO_ON) || | 73 | if((PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_ON) || |
74 | ((*msg)[i].msg_style == PAM_PROMPT_ECHO_OFF) || | 74 | (PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_OFF) || |
75 | (i == num_msg - 1)) { | 75 | (i == num_msg - 1)) { |
76 | j++; | 76 | j++; |
77 | } | 77 | } |
@@ -79,7 +79,7 @@ do_conversation2(int num_msg, const struct pam_message **msg, | |||
79 | packet_put_int(j); /* Number of prompts. */ | 79 | packet_put_int(j); /* Number of prompts. */ |
80 | context_pam2.num_expected = j; | 80 | context_pam2.num_expected = j; |
81 | for (i = 0, j = 0; i < num_msg; i++) { | 81 | for (i = 0, j = 0; i < num_msg; i++) { |
82 | switch((*msg)[i].msg_style) { | 82 | switch(PAM_MSG_MEMBER(msg, i, msg_style)) { |
83 | case PAM_PROMPT_ECHO_ON: | 83 | case PAM_PROMPT_ECHO_ON: |
84 | echo = 1; | 84 | echo = 1; |
85 | break; | 85 | break; |
@@ -91,18 +91,18 @@ do_conversation2(int num_msg, const struct pam_message **msg, | |||
91 | break; | 91 | break; |
92 | } | 92 | } |
93 | if(text) { | 93 | if(text) { |
94 | tmp = xmalloc(strlen(text) + strlen((*msg)[i].msg) + 2); | 94 | tmp = xmalloc(strlen(text) + strlen(PAM_MSG_MEMBER(msg, i, msg)) + 2); |
95 | strcpy(tmp, text); | 95 | strcpy(tmp, text); |
96 | strcat(tmp, "\n"); | 96 | strcat(tmp, "\n"); |
97 | strcat(tmp, (*msg)[i].msg); | 97 | strcat(tmp, PAM_MSG_MEMBER(msg, i, msg)); |
98 | xfree(text); | 98 | xfree(text); |
99 | text = tmp; | 99 | text = tmp; |
100 | tmp = NULL; | 100 | tmp = NULL; |
101 | } else { | 101 | } else { |
102 | text = xstrdup((*msg)[i].msg); | 102 | text = xstrdup(PAM_MSG_MEMBER(msg, i, msg)); |
103 | } | 103 | } |
104 | if(((*msg)[i].msg_style == PAM_PROMPT_ECHO_ON) || | 104 | if((PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_ON) || |
105 | ((*msg)[i].msg_style == PAM_PROMPT_ECHO_OFF) || | 105 | (PAM_MSG_MEMBER(msg, i, msg_style) == PAM_PROMPT_ECHO_OFF) || |
106 | (i == num_msg - 1)) { | 106 | (i == num_msg - 1)) { |
107 | debug("sending prompt ssh-%d(pam-%d) = \"%s\"", | 107 | debug("sending prompt ssh-%d(pam-%d) = \"%s\"", |
108 | j, i, text); | 108 | j, i, text); |