summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_subdomains.c11
-rw-r--r--src/providers/ipa/ipa_subdomains.c9
-rw-r--r--src/responder/common/responder_get_domains.c3
4 files changed, 17 insertions, 8 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index d22186cb..25304289 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -380,9 +380,11 @@ errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx,
errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sysdb_subdom **info);
errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sysdb_subdom *domain_info);
errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 1f85b572..6a3f9ee6 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -130,6 +130,7 @@ done:
errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sysdb_subdom **_info)
{
errno_t ret;
@@ -155,8 +156,7 @@ errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
goto done;
}
- basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE,
- sysdb->domain->name);
+ basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, domain->name);
if (basedn == NULL) {
ret = EIO;
goto done;
@@ -217,6 +217,7 @@ done:
}
errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sysdb_subdom *domain_info)
{
TALLOC_CTX *tmp_ctx;
@@ -230,7 +231,7 @@ errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
return ENOMEM;
}
- ret = sysdb_master_domain_get_info(tmp_ctx, sysdb, &current_info);
+ ret = sysdb_master_domain_get_info(tmp_ctx, sysdb, domain, &current_info);
if (ret != EOK) {
goto done;
}
@@ -241,8 +242,8 @@ errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
goto done;
}
- msg->dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE,
- sysdb->domain->name);
+ msg->dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
+ SYSDB_DOM_BASE, domain->name);
if (msg->dn == NULL) {
ret = EIO;
goto done;
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 878b8979..3a91c580 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -782,13 +782,16 @@ static void ipa_subdomains_handler_ranges_done(struct tevent_req *req)
struct sysdb_subdom *domain_info;
struct range_info **range_list = NULL;
struct sysdb_ctx *sysdb;
+ struct sss_domain_info *domain;
ctx = tevent_req_callback_data(req, struct ipa_subdomains_req_ctx);
be_req = ctx->be_req;
if (be_req && be_req->sysdb) {
sysdb = be_req->sysdb;
+ domain = be_req->domain;
} else {
sysdb = ctx->sd_ctx->be_ctx->sysdb;
+ domain = ctx->sd_ctx->be_ctx->domain;
}
ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply);
@@ -813,7 +816,7 @@ static void ipa_subdomains_handler_ranges_done(struct tevent_req *req)
}
- ret = sysdb_master_domain_get_info(ctx, sysdb, &domain_info);
+ ret = sysdb_master_domain_get_info(ctx, sysdb, domain, &domain_info);
if (ret != EOK) {
goto done;
}
@@ -890,7 +893,9 @@ static void ipa_subdomains_handler_master_done(struct tevent_req *req)
goto done;
}
- ret = sysdb_master_domain_add_info(ctx->sd_ctx->be_ctx->sysdb, domain_info);
+ ret = sysdb_master_domain_add_info(ctx->sd_ctx->be_ctx->sysdb,
+ ctx->sd_ctx->be_ctx->domain,
+ domain_info);
goto done;
} else {
ctx->search_base_iter++;
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index c98c47b3..d40f373e 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -330,7 +330,8 @@ process_subdomains(struct sss_domain_info *domain)
}
if (domain->flat_name == NULL || domain->domain_id == NULL) {
- ret = sysdb_master_domain_get_info(domain, domain->sysdb, &master_info);
+ ret = sysdb_master_domain_get_info(domain, domain->sysdb,
+ domain, &master_info);
if (ret != EOK) {
DEBUG(SSSDBG_FUNC_DATA, ("sysdb_master_domain_get_info " \
"failed.\n"));