Blame SOURCES/0084-ldap-rename-sdap_autofs_get_map-to-sdap_autofs_enume.patch

5fca41
From bd15a135c1b73996208557f36718410a7a6b20b2 Mon Sep 17 00:00:00 2001
5fca41
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
5fca41
Date: Thu, 15 Aug 2019 11:56:55 +0200
5fca41
Subject: [PATCH 84/90] ldap: rename sdap_autofs_get_map to
5fca41
 sdap_autofs_enumerate
5fca41
MIME-Version: 1.0
5fca41
Content-Type: text/plain; charset=UTF-8
5fca41
Content-Transfer-Encoding: 8bit
5fca41
5fca41
get_map name will be later used to obtain only the map object.
5fca41
5fca41
Resolves:
5fca41
https://pagure.io/SSSD/sssd/issue/2607
5fca41
5fca41
Reviewed-by: Tomáš Halman <thalman@redhat.com>
5fca41
---
5fca41
 src/providers/ldap/sdap_autofs.c | 60 ++++++++++++++++----------------
5fca41
 1 file changed, 30 insertions(+), 30 deletions(-)
5fca41
5fca41
diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c
5fca41
index f65028d4e..5b9146199 100644
5fca41
--- a/src/providers/ldap/sdap_autofs.c
5fca41
+++ b/src/providers/ldap/sdap_autofs.c
5fca41
@@ -34,7 +34,7 @@
5fca41
 #include "db/sysdb_autofs.h"
5fca41
 #include "util/util.h"
5fca41
 
5fca41
-struct autofs_get_map_state {
5fca41
+struct sdap_autofs_enumerate_state {
5fca41
     struct tevent_context *ev;
5fca41
     struct sdap_id_ctx *ctx;
5fca41
     struct sdap_id_op *op;
5fca41
@@ -44,23 +44,23 @@ struct autofs_get_map_state {
5fca41
 };
5fca41
 
5fca41
 static errno_t
5fca41
-sdap_autofs_get_map_retry(struct tevent_req *req);
5fca41
+sdap_autofs_enumerate_retry(struct tevent_req *req);
5fca41
 static void
5fca41
-sdap_autofs_get_map_connect_done(struct tevent_req *subreq);
5fca41
+sdap_autofs_enumerate_connect_done(struct tevent_req *subreq);
5fca41
 static void
5fca41
-sdap_autofs_get_map_done(struct tevent_req *req);
5fca41
+sdap_autofs_enumerate_done(struct tevent_req *req);
5fca41
 
5fca41
 static struct tevent_req *
5fca41
-sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx,
5fca41
-                         struct tevent_context *ev,
5fca41
-                         struct sdap_id_ctx *ctx,
5fca41
-                         const char *map_name)
5fca41
+sdap_autofs_enumerate_send(TALLOC_CTX *mem_ctx,
5fca41
+                           struct tevent_context *ev,
5fca41
+                           struct sdap_id_ctx *ctx,
5fca41
+                           const char *map_name)
5fca41
 {
5fca41
     struct tevent_req *req;
5fca41
-    struct autofs_get_map_state *state;
5fca41
+    struct sdap_autofs_enumerate_state *state;
5fca41
     int ret;
5fca41
 
5fca41
-    req = tevent_req_create(mem_ctx, &state, struct autofs_get_map_state);
5fca41
+    req = tevent_req_create(mem_ctx, &state, struct sdap_autofs_enumerate_state);
5fca41
     if (!req) return NULL;
5fca41
 
5fca41
     state->ev = ev;
5fca41
@@ -75,7 +75,7 @@ sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx,
5fca41
         goto fail;
5fca41
     }
5fca41
 
5fca41
-    ret = sdap_autofs_get_map_retry(req);
5fca41
+    ret = sdap_autofs_enumerate_retry(req);
5fca41
     if (ret != EOK) {
5fca41
         goto fail;
5fca41
     }
5fca41
@@ -89,10 +89,10 @@ fail:
5fca41
 }
5fca41
 
5fca41
 static errno_t
5fca41
-sdap_autofs_get_map_retry(struct tevent_req *req)
5fca41
+sdap_autofs_enumerate_retry(struct tevent_req *req)
5fca41
 {
5fca41
-    struct autofs_get_map_state *state =
5fca41
-                tevent_req_data(req, struct autofs_get_map_state);
5fca41
+    struct sdap_autofs_enumerate_state *state =
5fca41
+                tevent_req_data(req, struct sdap_autofs_enumerate_state);
5fca41
     struct tevent_req *subreq;
5fca41
     int ret = EOK;
5fca41
 
5fca41
@@ -101,17 +101,17 @@ sdap_autofs_get_map_retry(struct tevent_req *req)
5fca41
         return ret;
5fca41
     }
5fca41
 
5fca41
-    tevent_req_set_callback(subreq, sdap_autofs_get_map_connect_done, req);
5fca41
+    tevent_req_set_callback(subreq, sdap_autofs_enumerate_connect_done, req);
5fca41
     return EOK;
5fca41
 }
5fca41
 
5fca41
 static void
5fca41
-sdap_autofs_get_map_connect_done(struct tevent_req *subreq)
5fca41
+sdap_autofs_enumerate_connect_done(struct tevent_req *subreq)
5fca41
 {
5fca41
     struct tevent_req *req = tevent_req_callback_data(subreq,
5fca41
                                                       struct tevent_req);
5fca41
-    struct autofs_get_map_state *state =
5fca41
-                tevent_req_data(req, struct autofs_get_map_state);
5fca41
+    struct sdap_autofs_enumerate_state *state =
5fca41
+                tevent_req_data(req, struct sdap_autofs_enumerate_state);
5fca41
     int dp_error = DP_ERR_FATAL;
5fca41
     int ret;
5fca41
 
5fca41
@@ -137,17 +137,17 @@ sdap_autofs_get_map_connect_done(struct tevent_req *subreq)
5fca41
         tevent_req_error(req, ENOMEM);
5fca41
         return;
5fca41
     }
5fca41
-    tevent_req_set_callback(subreq, sdap_autofs_get_map_done, req);
5fca41
+    tevent_req_set_callback(subreq, sdap_autofs_enumerate_done, req);
5fca41
 
5fca41
 }
5fca41
 
5fca41
 static void
5fca41
-sdap_autofs_get_map_done(struct tevent_req *subreq)
5fca41
+sdap_autofs_enumerate_done(struct tevent_req *subreq)
5fca41
 {
5fca41
     struct tevent_req *req = tevent_req_callback_data(subreq,
5fca41
                                                       struct tevent_req);
5fca41
-    struct autofs_get_map_state *state =
5fca41
-        tevent_req_data(req, struct autofs_get_map_state);
5fca41
+    struct sdap_autofs_enumerate_state *state =
5fca41
+        tevent_req_data(req, struct sdap_autofs_enumerate_state);
5fca41
     int dp_error = DP_ERR_FATAL;
5fca41
     int ret;
5fca41
 
5fca41
@@ -157,7 +157,7 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
5fca41
     ret = sdap_id_op_done(state->op, ret, &dp_error);
5fca41
     if (dp_error == DP_ERR_OK && ret != EOK) {
5fca41
         /* retry */
5fca41
-        ret = sdap_autofs_get_map_retry(req);
5fca41
+        ret = sdap_autofs_enumerate_retry(req);
5fca41
         if (ret != EOK) {
5fca41
             tevent_req_error(req, ret);
5fca41
             return;
5fca41
@@ -187,10 +187,10 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
5fca41
 }
5fca41
 
5fca41
 static errno_t
5fca41
-sdap_autofs_get_map_recv(struct tevent_req *req, int *dp_error_out)
5fca41
+sdap_autofs_enumerate_recv(struct tevent_req *req, int *dp_error_out)
5fca41
 {
5fca41
-    struct autofs_get_map_state *state =
5fca41
-        tevent_req_data(req, struct autofs_get_map_state);
5fca41
+    struct sdap_autofs_enumerate_state *state =
5fca41
+        tevent_req_data(req, struct sdap_autofs_enumerate_state);
5fca41
 
5fca41
     if (dp_error_out) {
5fca41
         *dp_error_out = state->dp_error;
5fca41
@@ -217,7 +217,6 @@ sdap_autofs_enumerate_handler_send(TALLOC_CTX *mem_ctx,
5fca41
     struct tevent_req *subreq;
5fca41
     struct tevent_req *req;
5fca41
     const char *master_map;
5fca41
-
5fca41
     errno_t ret;
5fca41
 
5fca41
     req = tevent_req_create(mem_ctx, &state, struct sdap_autofs_enumerate_handler_state);
5fca41
@@ -241,8 +240,8 @@ sdap_autofs_enumerate_handler_send(TALLOC_CTX *mem_ctx,
5fca41
         }
5fca41
     }
5fca41
 
5fca41
-    subreq = sdap_autofs_get_map_send(mem_ctx, params->ev,
5fca41
-                                      id_ctx, data->mapname);
5fca41
+    subreq = sdap_autofs_enumerate_send(mem_ctx, params->ev,
5fca41
+                                        id_ctx, data->mapname);
5fca41
     if (subreq == NULL) {
5fca41
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send request for %s.\n",
5fca41
               data->mapname);
5fca41
@@ -262,6 +261,7 @@ immediately:
5fca41
     tevent_req_post(req, params->ev);
5fca41
 
5fca41
     return req;
5fca41
+
5fca41
 }
5fca41
 
5fca41
 static void sdap_autofs_enumerate_handler_done(struct tevent_req *subreq)
5fca41
@@ -274,7 +274,7 @@ static void sdap_autofs_enumerate_handler_done(struct tevent_req *subreq)
5fca41
     req = tevent_req_callback_data(subreq, struct tevent_req);
5fca41
     state = tevent_req_data(req, struct sdap_autofs_enumerate_handler_state);
5fca41
 
5fca41
-    ret = sdap_autofs_get_map_recv(subreq, &dp_error);
5fca41
+    ret = sdap_autofs_enumerate_recv(subreq, &dp_error);
5fca41
     talloc_zfree(subreq);
5fca41
 
5fca41
     /* TODO For backward compatibility we always return EOK to DP now. */
5fca41
-- 
5fca41
2.20.1
5fca41