From 749cfb5d3270b5daf389d51a0dbd3fd2aec6e05d Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 27 May 2013 08:48:02 +0200 Subject: LDAP: new SDAP domain structure Previously an sdap_id_ctx was always tied to one domain with a single set of search bases. But with the introduction of Global Catalog lookups, primary domain and subdomains might have different search bases. This patch introduces a new structure sdap_domain that contains an sssd domain or subdomain and a set of search bases. With this patch, there is only one sdap_domain that describes the primary domain. --- src/providers/ad/ad_subdomains.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/providers/ad/ad_subdomains.c') diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c index da0c85e76..098663cc8 100644 --- a/src/providers/ad/ad_subdomains.c +++ b/src/providers/ad/ad_subdomains.c @@ -44,6 +44,7 @@ struct ad_subdomains_ctx { struct be_ctx *be_ctx; struct sdap_id_ctx *sdap_id_ctx; + struct sdap_domain *sdom; struct sss_idmap_ctx *idmap_ctx; char *domain_name; @@ -164,7 +165,7 @@ static errno_t ad_subdomains_get_master_sid(struct ad_subdomains_req_ctx *ctx) const char *master_sid_attrs[] = {AD_AT_OBJECT_SID, NULL}; - base = ctx->sd_ctx->sdap_id_ctx->opts->search_bases[ctx->base_iter]; + base = ctx->sd_ctx->sdom->search_bases[ctx->base_iter]; if (base == NULL) { return EOK; } @@ -497,6 +498,7 @@ int ad_subdom_init(struct be_ctx *be_ctx, } ctx->be_ctx = be_ctx; + ctx->sdom = id_ctx->sdap_id_ctx->opts->sdom; ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; ctx->domain_name = talloc_strdup(ctx, ad_domain); if (ctx->domain_name == NULL) { -- cgit