diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-10-03 23:04:11 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-10-03 23:04:11 +0800 |
commit | 142a0f8a83262b278d7d4eeaada2801a039c94c8 (patch) | |
tree | 3f6d511c4de2a24cc22b01fc4fb10ffd7e590973 /svr-authpam.c | |
parent | d1dec41f7656d7937f1cce64df1cc41121f3e44d (diff) |
Send PAM error messages as a banner messages
Patch from Martin Donnelly, modified.
Diffstat (limited to 'svr-authpam.c')
-rw-r--r-- | svr-authpam.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/svr-authpam.c b/svr-authpam.c index e84f076..a586727 100644 --- a/svr-authpam.c +++ b/svr-authpam.c @@ -142,6 +142,22 @@ pamConvFunc(int num_msg, (*respp) = resp; break; + case PAM_ERROR_MSG: + case PAM_TEXT_INFO: + + if (msg_len > 0) { + buffer * pam_err = buf_new(msg_len + 4); + buf_setpos(pam_err, 0); + buf_putbytes(pam_err, "\r\n", 2); + buf_putbytes(pam_err, (*msg)->msg, msg_len); + buf_putbytes(pam_err, "\r\n", 2); + buf_setpos(pam_err, 0); + + send_msg_userauth_banner(pam_err); + buf_free(pam_err); + } + break; + default: TRACE(("Unknown message type")) rc = PAM_CONV_ERR; |