aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-06-26 08:46:44 +0200
committerAndreas Schneider <asn@samba.org>2018-09-20 12:07:08 +0200
commita3851def86755da09186622380e9be0b74aa6aea (patch)
tree925e3e560b32452b25c189badec689664ffb87d5
parenta331e42539d54a5cfdb6df41b5ec0d1b60043648 (diff)
downloadpam_wrapper-a3851def86755da09186622380e9be0b74aa6aea.tar.gz
pam_wrapper-a3851def86755da09186622380e9be0b74aa6aea.tar.xz
pam_wrapper-a3851def86755da09186622380e9be0b74aa6aea.zip
pwrap: Add PAM_TEXT_INFO and PAM_ERROR_MSG to responses
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
-rw-r--r--src/libpamtest.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libpamtest.c b/src/libpamtest.c
index 74da180..4474736 100644
--- a/src/libpamtest.c
+++ b/src/libpamtest.c
@@ -271,6 +271,14 @@ static int pamtest_simple_conv(int num_msg,
cctx->echo_on_idx++;
break;
case PAM_ERROR_MSG:
+ if (reply != NULL) {
+ ret = add_to_reply(&reply[i], msgm[i]->msg);
+ if (ret != PAM_SUCCESS) {
+ free_reply(reply, num_msg);
+ return ret;
+ }
+ }
+
if (cctx->data->out_err != NULL) {
memcpy(cctx->data->out_err[cctx->err_idx],
msgm[i]->msg,
@@ -280,6 +288,14 @@ static int pamtest_simple_conv(int num_msg,
}
break;
case PAM_TEXT_INFO:
+ if (reply != NULL) {
+ ret = add_to_reply(&reply[i], msgm[i]->msg);
+ if (ret != PAM_SUCCESS) {
+ free_reply(reply, num_msg);
+ return ret;
+ }
+ }
+
if (cctx->data->out_info != NULL) {
memcpy(cctx->data->out_info[cctx->info_idx],
msgm[i]->msg,