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,
#n177'>177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255