summaryrefslogtreecommitdiff
path: root/src/providers/ad/ad_init.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-05-15 17:36:44 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-07 00:14:13 +0200
commit55d80b1301fe969fb4ba2b9481027887b9462dbb (patch)
tree7f4f7fdc4a1f913c08506452450ac2972b01acdb /src/providers/ad/ad_init.c
parentd27d7f2c270b69d0805633c4bedcf6d806acd5cd (diff)
downloadsssd-55d80b1301fe969fb4ba2b9481027887b9462dbb.tar.gz
sssd-55d80b1301fe969fb4ba2b9481027887b9462dbb.tar.bz2
sssd-55d80b1301fe969fb4ba2b9481027887b9462dbb.zip
AD: Add additional service to support Global Catalog lookups
When fixed host names of AD servers are configured in the config file, we can't know (unlike when service discovery is at play) if the servers are Global Catalogs or not. This patch adds a private data to servers read from the config file that denote whether the server can be tried for contacting the Global Catalog port or just LDAP. The GC or LDAP URIs are generated based on contents of this private data structure. Because SSSD sticks to a working server, we don't have to disable or remove the faulty GC servers from the list.
Diffstat (limited to 'src/providers/ad/ad_init.c')
-rw-r--r--src/providers/ad/ad_init.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
index aada14ec..cb73aca3 100644
--- a/src/providers/ad/ad_init.c
+++ b/src/providers/ad/ad_init.c
@@ -140,6 +140,12 @@ sssm_ad_id_init(struct be_ctx *bectx,
return ENOMEM;
}
ad_ctx->sdap_id_ctx = sdap_ctx;
+ ad_ctx->ldap_ctx = sdap_ctx->conn;
+
+ ad_ctx->gc_ctx = sdap_id_ctx_conn_add(sdap_ctx, ad_options->service->gc);
+ if (sdap_ctx == NULL) {
+ return ENOMEM;
+ }
ret = ad_dyndns_init(sdap_ctx->be, ad_options);
if (ret != EOK) {
@@ -148,11 +154,6 @@ sssm_ad_id_init(struct be_ctx *bectx,
/* Continue without DNS updates */
}
- ret = sdap_id_setup_tasks(sdap_ctx);
- if (ret != EOK) {
- goto done;
- }
-
ret = sdap_setup_child();
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
@@ -169,6 +170,11 @@ sssm_ad_id_init(struct be_ctx *bectx,
goto done;
}
+ ret = sdap_id_setup_tasks(sdap_ctx);
+ if (ret != EOK) {
+ goto done;
+ }
+
/* Set up the ID mapping object */
ret = sdap_idmap_init(sdap_ctx, sdap_ctx, &sdap_ctx->opts->idmap_ctx);
if (ret != EOK) goto done;