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