Blame SOURCES/0014-ad-rename-ad_master_domain_-to-ad_domain_info_.patch

1bb595
From d3089173dd8be85a83cf0236e116ba8e11326a6d Mon Sep 17 00:00:00 2001
1bb595
From: Sumit Bose <sbose@redhat.com>
1bb595
Date: Thu, 7 May 2020 16:51:02 +0200
1bb595
Subject: [PATCH 14/19] ad: rename ad_master_domain_* to ad_domain_info_*
1bb595
MIME-Version: 1.0
1bb595
Content-Type: text/plain; charset=UTF-8
1bb595
Content-Transfer-Encoding: 8bit
1bb595
1bb595
The ad_master_domain_{send|recv} are not specific to the master domain
1bb595
so a more generic name seems to be suitable.
1bb595
1bb595
Resolves: https://github.com/SSSD/sssd/issues/5151
1bb595
1bb595
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
1bb595
---
1bb595
 src/providers/ad/ad_domain_info.c | 64 +++++++++++++++----------------
1bb595
 src/providers/ad/ad_domain_info.h | 10 ++---
1bb595
 src/providers/ad/ad_gpo.c         |  8 ++--
1bb595
 src/providers/ad/ad_id.c          | 14 +++----
1bb595
 src/providers/ad/ad_resolver.c    |  8 ++--
1bb595
 src/providers/ad/ad_subdomains.c  |  8 ++--
1bb595
 6 files changed, 56 insertions(+), 56 deletions(-)
1bb595
1bb595
diff --git a/src/providers/ad/ad_domain_info.c b/src/providers/ad/ad_domain_info.c
1bb595
index 5302c8083..52b2e2442 100644
1bb595
--- a/src/providers/ad/ad_domain_info.c
1bb595
+++ b/src/providers/ad/ad_domain_info.c
1bb595
@@ -175,7 +175,7 @@ done:
1bb595
     return ret;
1bb595
 }
1bb595
 
1bb595
-struct ad_master_domain_state {
1bb595
+struct ad_domain_info_state {
1bb595
     struct tevent_context *ev;
1bb595
     struct sdap_id_conn_ctx *conn;
1bb595
     struct sdap_id_op *id_op;
1bb595
@@ -191,22 +191,22 @@ struct ad_master_domain_state {
1bb595
     char *sid;
1bb595
 };
1bb595
 
1bb595
-static errno_t ad_master_domain_next(struct tevent_req *req);
1bb595
-static void ad_master_domain_next_done(struct tevent_req *subreq);
1bb595
-static void ad_master_domain_netlogon_done(struct tevent_req *req);
1bb595
+static errno_t ad_domain_info_next(struct tevent_req *req);
1bb595
+static void ad_domain_info_next_done(struct tevent_req *subreq);
1bb595
+static void ad_domain_info_netlogon_done(struct tevent_req *req);
1bb595
 
1bb595
 struct tevent_req *
1bb595
-ad_master_domain_send(TALLOC_CTX *mem_ctx,
1bb595
-                      struct tevent_context *ev,
1bb595
-                      struct sdap_id_conn_ctx *conn,
1bb595
-                      struct sdap_id_op *op,
1bb595
-                      const char *dom_name)
1bb595
+ad_domain_info_send(TALLOC_CTX *mem_ctx,
1bb595
+                    struct tevent_context *ev,
1bb595
+                    struct sdap_id_conn_ctx *conn,
1bb595
+                    struct sdap_id_op *op,
1bb595
+                    const char *dom_name)
1bb595
 {
1bb595
     errno_t ret;
1bb595
     struct tevent_req *req;
1bb595
-    struct ad_master_domain_state *state;
1bb595
+    struct ad_domain_info_state *state;
1bb595
 
1bb595
-    req = tevent_req_create(mem_ctx, &state, struct ad_master_domain_state);
1bb595
+    req = tevent_req_create(mem_ctx, &state, struct ad_domain_info_state);
1bb595
     if (!req) return NULL;
1bb595
 
1bb595
     state->ev = ev;
1bb595
@@ -216,7 +216,7 @@ ad_master_domain_send(TALLOC_CTX *mem_ctx,
1bb595
     state->opts = conn->id_ctx->opts;
1bb595
     state->dom_name = dom_name;
1bb595
 
1bb595
-    ret = ad_master_domain_next(req);
1bb595
+    ret = ad_domain_info_next(req);
1bb595
     if (ret != EOK && ret != EAGAIN) {
1bb595
         goto immediate;
1bb595
     }
1bb595
@@ -234,14 +234,14 @@ immediate:
1bb595
 }
1bb595
 
1bb595
 static errno_t
1bb595
-ad_master_domain_next(struct tevent_req *req)
1bb595
+ad_domain_info_next(struct tevent_req *req)
1bb595
 {
1bb595
     struct tevent_req *subreq;
1bb595
     struct sdap_search_base *base;
1bb595
     const char *master_sid_attrs[] = {AD_AT_OBJECT_SID, NULL};
1bb595
 
1bb595
-    struct ad_master_domain_state *state =
1bb595
-        tevent_req_data(req, struct ad_master_domain_state);
1bb595
+    struct ad_domain_info_state *state =
1bb595
+        tevent_req_data(req, struct ad_domain_info_state);
1bb595
 
1bb595
     base = state->opts->sdom->search_bases[state->base_iter];
1bb595
     if (base == NULL) {
1bb595
@@ -261,13 +261,13 @@ ad_master_domain_next(struct tevent_req *req)
1bb595
         DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n");
1bb595
         return ENOMEM;
1bb595
     }
1bb595
-    tevent_req_set_callback(subreq, ad_master_domain_next_done, req);
1bb595
+    tevent_req_set_callback(subreq, ad_domain_info_next_done, req);
1bb595
 
1bb595
     return EAGAIN;
1bb595
 }
1bb595
 
1bb595
 static void
1bb595
-ad_master_domain_next_done(struct tevent_req *subreq)
1bb595
+ad_domain_info_next_done(struct tevent_req *subreq)
1bb595
 {
1bb595
     errno_t ret;
1bb595
     size_t reply_count;
1bb595
@@ -281,8 +281,8 @@ ad_master_domain_next_done(struct tevent_req *subreq)
1bb595
 
1bb595
     struct tevent_req *req = tevent_req_callback_data(subreq,
1bb595
                                                       struct tevent_req);
1bb595
-    struct ad_master_domain_state *state =
1bb595
-        tevent_req_data(req, struct ad_master_domain_state);
1bb595
+    struct ad_domain_info_state *state =
1bb595
+        tevent_req_data(req, struct ad_domain_info_state);
1bb595
 
1bb595
     ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply);
1bb595
     talloc_zfree(subreq);
1bb595
@@ -293,7 +293,7 @@ ad_master_domain_next_done(struct tevent_req *subreq)
1bb595
 
1bb595
     if (reply_count == 0) {
1bb595
         state->base_iter++;
1bb595
-        ret = ad_master_domain_next(req);
1bb595
+        ret = ad_domain_info_next(req);
1bb595
         if (ret == EAGAIN) {
1bb595
             /* Async request will get us back here again */
1bb595
             return;
1bb595
@@ -362,7 +362,7 @@ ad_master_domain_next_done(struct tevent_req *subreq)
1bb595
         goto done;
1bb595
     }
1bb595
 
1bb595
-    tevent_req_set_callback(subreq, ad_master_domain_netlogon_done, req);
1bb595
+    tevent_req_set_callback(subreq, ad_domain_info_netlogon_done, req);
1bb595
     return;
1bb595
 
1bb595
 done:
1bb595
@@ -370,7 +370,7 @@ done:
1bb595
 }
1bb595
 
1bb595
 static void
1bb595
-ad_master_domain_netlogon_done(struct tevent_req *subreq)
1bb595
+ad_domain_info_netlogon_done(struct tevent_req *subreq)
1bb595
 {
1bb595
     int ret;
1bb595
     size_t reply_count;
1bb595
@@ -378,8 +378,8 @@ ad_master_domain_netlogon_done(struct tevent_req *subreq)
1bb595
 
1bb595
     struct tevent_req *req = tevent_req_callback_data(subreq,
1bb595
                                                       struct tevent_req);
1bb595
-    struct ad_master_domain_state *state =
1bb595
-        tevent_req_data(req, struct ad_master_domain_state);
1bb595
+    struct ad_domain_info_state *state =
1bb595
+        tevent_req_data(req, struct ad_domain_info_state);
1bb595
 
1bb595
     ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply);
1bb595
     talloc_zfree(subreq);
1bb595
@@ -422,15 +422,15 @@ done:
1bb595
 }
1bb595
 
1bb595
 errno_t
1bb595
-ad_master_domain_recv(struct tevent_req *req,
1bb595
-                      TALLOC_CTX *mem_ctx,
1bb595
-                      char **_flat,
1bb595
-                      char **_id,
1bb595
-                      char **_site,
1bb595
-                      char **_forest)
1bb595
+ad_domain_info_recv(struct tevent_req *req,
1bb595
+                    TALLOC_CTX *mem_ctx,
1bb595
+                    char **_flat,
1bb595
+                    char **_id,
1bb595
+                    char **_site,
1bb595
+                    char **_forest)
1bb595
 {
1bb595
-    struct ad_master_domain_state *state = tevent_req_data(req,
1bb595
-                                              struct ad_master_domain_state);
1bb595
+    struct ad_domain_info_state *state = tevent_req_data(req,
1bb595
+                                              struct ad_domain_info_state);
1bb595
 
1bb595
     TEVENT_REQ_RETURN_ON_ERROR(req);
1bb595
 
1bb595
diff --git a/src/providers/ad/ad_domain_info.h b/src/providers/ad/ad_domain_info.h
1bb595
index b96e8a3c3..631e543f5 100644
1bb595
--- a/src/providers/ad/ad_domain_info.h
1bb595
+++ b/src/providers/ad/ad_domain_info.h
1bb595
@@ -22,22 +22,22 @@
1bb595
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
1bb595
 */
1bb595
 
1bb595
-#ifndef _AD_MASTER_DOMAIN_H_
1bb595
-#define _AD_MASTER_DOMAIN_H_
1bb595
+#ifndef _AD_DOMAIN_INFO_H_
1bb595
+#define _AD_DOMAIN_INFO_H_
1bb595
 
1bb595
 struct tevent_req *
1bb595
-ad_master_domain_send(TALLOC_CTX *mem_ctx,
1bb595
+ad_domain_info_send(TALLOC_CTX *mem_ctx,
1bb595
                       struct tevent_context *ev,
1bb595
                       struct sdap_id_conn_ctx *conn,
1bb595
                       struct sdap_id_op *op,
1bb595
                       const char *dom_name);
1bb595
 
1bb595
 errno_t
1bb595
-ad_master_domain_recv(struct tevent_req *req,
1bb595
+ad_domain_info_recv(struct tevent_req *req,
1bb595
                       TALLOC_CTX *mem_ctx,
1bb595
                       char **_flat,
1bb595
                       char **_id,
1bb595
                       char **_site,
1bb595
                       char **_forest);
1bb595
 
1bb595
-#endif /* _AD_MASTER_DOMAIN_H_ */
1bb595
+#endif /* _AD_DOMAIN_INFO_H_ */
1bb595
diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c
1bb595
index 1524c4bfc..53560a754 100644
1bb595
--- a/src/providers/ad/ad_gpo.c
1bb595
+++ b/src/providers/ad/ad_gpo.c
1bb595
@@ -3151,11 +3151,11 @@ ad_gpo_process_som_send(TALLOC_CTX *mem_ctx,
1bb595
         goto immediately;
1bb595
     }
1bb595
 
1bb595
-    subreq = ad_master_domain_send(state, state->ev, conn,
1bb595
-                                   state->sdap_op, domain_name);
1bb595
+    subreq = ad_domain_info_send(state, state->ev, conn,
1bb595
+                                 state->sdap_op, domain_name);
1bb595
 
1bb595
     if (subreq == NULL) {
1bb595
-        DEBUG(SSSDBG_OP_FAILURE, "ad_master_domain_send failed.\n");
1bb595
+        DEBUG(SSSDBG_OP_FAILURE, "ad_domain_info_send failed.\n");
1bb595
         ret = ENOMEM;
1bb595
         goto immediately;
1bb595
     }
1bb595
@@ -3188,7 +3188,7 @@ ad_gpo_site_name_retrieval_done(struct tevent_req *subreq)
1bb595
     state = tevent_req_data(req, struct ad_gpo_process_som_state);
1bb595
 
1bb595
     /* gpo code only cares about the site name */
1bb595
-    ret = ad_master_domain_recv(subreq, state, NULL, NULL, &site, NULL);
1bb595
+    ret = ad_domain_info_recv(subreq, state, NULL, NULL, &site, NULL);
1bb595
     talloc_zfree(subreq);
1bb595
 
1bb595
     if (ret != EOK || site == NULL) {
1bb595
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
1bb595
index 84e5c42ac..ca6486e03 100644
1bb595
--- a/src/providers/ad/ad_id.c
1bb595
+++ b/src/providers/ad/ad_id.c
1bb595
@@ -663,12 +663,12 @@ ad_enumeration_conn_done(struct tevent_req *subreq)
1bb595
         return;
1bb595
     }
1bb595
 
1bb595
-    subreq = ad_master_domain_send(state, state->ev,
1bb595
-                                   state->id_ctx->ldap_ctx,
1bb595
-                                   state->sdap_op,
1bb595
-                                   state->sdom->dom->name);
1bb595
+    subreq = ad_domain_info_send(state, state->ev,
1bb595
+                                  state->id_ctx->ldap_ctx,
1bb595
+                                  state->sdap_op,
1bb595
+                                  state->sdom->dom->name);
1bb595
     if (subreq == NULL) {
1bb595
-        DEBUG(SSSDBG_OP_FAILURE, "ad_master_domain_send failed.\n");
1bb595
+        DEBUG(SSSDBG_OP_FAILURE, "ad_domain_info_send failed.\n");
1bb595
         tevent_req_error(req, ret);
1bb595
         return;
1bb595
     }
1bb595
@@ -687,8 +687,8 @@ ad_enumeration_master_done(struct tevent_req *subreq)
1bb595
     char *master_sid;
1bb595
     char *forest;
1bb595
 
1bb595
-    ret = ad_master_domain_recv(subreq, state,
1bb595
-                                &flat_name, &master_sid, NULL, &forest);
1bb595
+    ret = ad_domain_info_recv(subreq, state,
1bb595
+                              &flat_name, &master_sid, NULL, &forest);
1bb595
     talloc_zfree(subreq);
1bb595
     if (ret != EOK) {
1bb595
         DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve master domain info\n");
1bb595
diff --git a/src/providers/ad/ad_resolver.c b/src/providers/ad/ad_resolver.c
1bb595
index b58f08ecf..c87706094 100644
1bb595
--- a/src/providers/ad/ad_resolver.c
1bb595
+++ b/src/providers/ad/ad_resolver.c
1bb595
@@ -317,10 +317,10 @@ ad_resolver_enumeration_conn_done(struct tevent_req *subreq)
1bb595
         return;
1bb595
     }
1bb595
 
1bb595
-    subreq = ad_master_domain_send(state, state->ev, id_ctx->conn,
1bb595
-                                   state->sdap_op, state->sdom->dom->name);
1bb595
+    subreq = ad_domain_info_send(state, state->ev, id_ctx->conn,
1bb595
+                                 state->sdap_op, state->sdom->dom->name);
1bb595
     if (subreq == NULL) {
1bb595
-        DEBUG(SSSDBG_OP_FAILURE, "ad_master_domain_send failed.\n");
1bb595
+        DEBUG(SSSDBG_OP_FAILURE, "ad_domain_info_send failed.\n");
1bb595
         tevent_req_error(req, ret);
1bb595
         return;
1bb595
     }
1bb595
@@ -346,7 +346,7 @@ ad_resolver_enumeration_master_done(struct tevent_req *subreq)
1bb595
     char *forest;
1bb595
     struct ad_id_ctx *ad_id_ctx;
1bb595
 
1bb595
-    ret = ad_master_domain_recv(subreq, state,
1bb595
+    ret = ad_domain_info_recv(subreq, state,
1bb595
                                 &flat_name, &master_sid, NULL, &forest);
1bb595
     talloc_zfree(subreq);
1bb595
     if (ret != EOK) {
1bb595
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
1bb595
index 06fbdb0ef..c53962283 100644
1bb595
--- a/src/providers/ad/ad_subdomains.c
1bb595
+++ b/src/providers/ad/ad_subdomains.c
1bb595
@@ -1756,8 +1756,8 @@ static void ad_subdomains_refresh_connect_done(struct tevent_req *subreq)
1bb595
     }
1bb595
 
1bb595
     /* connect to the DC we are a member of */
1bb595
-    subreq = ad_master_domain_send(state, state->ev, state->id_ctx->conn,
1bb595
-                                   state->sdap_op, state->sd_ctx->domain_name);
1bb595
+    subreq = ad_domain_info_send(state, state->ev, state->id_ctx->conn,
1bb595
+                                 state->sdap_op, state->sd_ctx->domain_name);
1bb595
     if (subreq == NULL) {
1bb595
         tevent_req_error(req, ENOMEM);
1bb595
         return;
1bb595
@@ -1779,8 +1779,8 @@ static void ad_subdomains_refresh_master_done(struct tevent_req *subreq)
1bb595
     req = tevent_req_callback_data(subreq, struct tevent_req);
1bb595
     state = tevent_req_data(req, struct ad_subdomains_refresh_state);
1bb595
 
1bb595
-    ret = ad_master_domain_recv(subreq, state, &flat_name, &master_sid,
1bb595
-                                NULL, &state->forest);
1bb595
+    ret = ad_domain_info_recv(subreq, state, &flat_name, &master_sid,
1bb595
+                              NULL, &state->forest);
1bb595
     talloc_zfree(subreq);
1bb595
     if (ret != EOK) {
1bb595
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get master domain information "
1bb595
-- 
1bb595
2.21.3
1bb595