Blame SOURCES/0082-PROXY-Copy-the-response-to-the-caller.patch

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