summaryrefslogtreecommitdiffhomepage
path: root/svr-authpam.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-10-03 23:04:11 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-10-03 23:04:11 +0800
commit142a0f8a83262b278d7d4eeaada2801a039c94c8 (patch)
tree3f6d511c4de2a24cc22b01fc4fb10ffd7e590973 /svr-authpam.c
parentd1dec41f7656d7937f1cce64df1cc41121f3e44d (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.c16
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;