Mercurial > dropbear
comparison svr-authpam.c @ 818:8fe36617bf4e
Send PAM error messages as a banner messages
Patch from Martin Donnelly, modified.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 03 Oct 2013 23:04:11 +0800 |
parents | a842469ce8ad |
children | fee485ce81eb |
comparison
equal
deleted
inserted
replaced
817:a625f9e135a4 | 818:8fe36617bf4e |
---|---|
140 resp->resp = m_strdup(userDatap->user); | 140 resp->resp = m_strdup(userDatap->user); |
141 TRACE(("userDatap->user='%s'", userDatap->user)) | 141 TRACE(("userDatap->user='%s'", userDatap->user)) |
142 (*respp) = resp; | 142 (*respp) = resp; |
143 break; | 143 break; |
144 | 144 |
145 case PAM_ERROR_MSG: | |
146 case PAM_TEXT_INFO: | |
147 | |
148 if (msg_len > 0) { | |
149 buffer * pam_err = buf_new(msg_len + 4); | |
150 buf_setpos(pam_err, 0); | |
151 buf_putbytes(pam_err, "\r\n", 2); | |
152 buf_putbytes(pam_err, (*msg)->msg, msg_len); | |
153 buf_putbytes(pam_err, "\r\n", 2); | |
154 buf_setpos(pam_err, 0); | |
155 | |
156 send_msg_userauth_banner(pam_err); | |
157 buf_free(pam_err); | |
158 } | |
159 break; | |
160 | |
145 default: | 161 default: |
146 TRACE(("Unknown message type")) | 162 TRACE(("Unknown message type")) |
147 rc = PAM_CONV_ERR; | 163 rc = PAM_CONV_ERR; |
148 break; | 164 break; |
149 } | 165 } |