From de307ab8e390deabc5df9884a3f762bfb1581936 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 14 Aug 2013 21:12:07 +0200 Subject: IPA: Enable AD sites when in server mode https://fedorahosted.org/sssd/ticket/1964 Currently the AD sites are enabled unconditionally --- src/providers/ipa/ipa_subdomains.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/providers/ipa/ipa_subdomains.c') diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index 9ded9954b..6e627c937 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -102,6 +102,8 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, struct ad_options *ad_options; struct ad_id_ctx *ad_id_ctx; const char *gc_service_name; + struct ad_srv_plugin_ctx *srv_ctx; + char *ad_domain; errno_t ret; ad_options = ad_create_default_options(id_ctx, id_ctx->server_mode->realm, @@ -112,7 +114,9 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, return ENOMEM; } - ret = dp_opt_set_string(ad_options->basic, AD_DOMAIN, subdom->name); + ad_domain = subdom->name; + + ret = dp_opt_set_string(ad_options->basic, AD_DOMAIN, ad_domain); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Cannot set AD domain\n")); talloc_free(ad_options); @@ -153,6 +157,19 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, ad_id_ctx->sdap_id_ctx->opts = ad_options->id; ad_options->id_ctx = ad_id_ctx; + /* use AD plugin */ + srv_ctx = ad_srv_plugin_ctx_init(be_ctx, be_ctx->be_res, + default_host_dbs, + ad_id_ctx->ad_options->id, + id_ctx->server_mode->hostname, + ad_domain); + if (srv_ctx == NULL) { + DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + return ENOMEM; + } + be_fo_set_srv_lookup_plugin(be_ctx, ad_srv_plugin_send, + ad_srv_plugin_recv, srv_ctx, "AD"); + ret = sdap_domain_subdom_add(ad_id_ctx->sdap_id_ctx, ad_id_ctx->sdap_id_ctx->opts->sdom, subdom->parent); -- cgit