From 807bbce25ffedb6f0d2d61831b5d5133e11aa84a Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 3 Dec 2018 23:26:46 +0100 Subject: [PATCH] PROXY: Copy the response to the caller Resolves: https://pagure.io/SSSD/sssd/issue/3892 Reviewed-by: Jakub Hrozek --- src/providers/proxy/proxy_auth.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c index 3c5affeb5..926ce98f4 100644 --- a/src/providers/proxy/proxy_auth.c +++ b/src/providers/proxy/proxy_auth.c @@ -570,6 +570,7 @@ done: static void proxy_pam_conv_done(struct tevent_req *subreq) { struct pam_data *response; + struct response_data *resp; struct proxy_conv_ctx *state; struct tevent_req *req; errno_t ret; @@ -583,8 +584,6 @@ static void proxy_pam_conv_done(struct tevent_req *subreq) /* Kill the child */ kill(state->pid, SIGKILL); - // TODO copy response to pd - if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get reply from child [%d]: %s\n", ret, sss_strerror(ret)); @@ -593,6 +592,19 @@ static void proxy_pam_conv_done(struct tevent_req *subreq) return; } + state->pd->pam_status = response->pam_status; + state->pd->account_locked = response->account_locked; + + for (resp = response->resp_list; resp != NULL; resp = resp->next) { + talloc_steal(state->pd, resp); + + if (resp->next == NULL) { + resp->next = state->pd->resp_list; + state->pd->resp_list = response->resp_list; + break; + } + } + DEBUG(SSSDBG_CONF_SETTINGS, "received: [%d][%s]\n", state->pd->pam_status, state->pd->domain); -- 2.19.1