summaryrefslogtreecommitdiffstats
path: root/src/providers/ad/ad_id.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-10-05 16:11:14 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-10-07 12:49:44 +0200
commitf1742784d9b1cffd74f67beeb26375124183428a (patch)
tree086d11435f8fd8f0e93354c1b5b9e044ea311ec8 /src/providers/ad/ad_id.c
parent15a4b34ccfcfbcec2c9ba529d0113adf251abc16 (diff)
downloadsssd-f1742784d9b1cffd74f67beeb26375124183428a.tar.gz
sssd-f1742784d9b1cffd74f67beeb26375124183428a.tar.xz
sssd-f1742784d9b1cffd74f67beeb26375124183428a.zip
AD: Consolidate connection list construction on ad_common.c
Reviewed-by: Sumit Bose <sbose@redhat.com> (cherry picked from commit afb21fd06690a0bec288a7970abf74ed2ea7dfdc)
Diffstat (limited to 'src/providers/ad/ad_id.c')
-rw-r--r--src/providers/ad/ad_id.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index be0cb3b12..51d378863 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -244,25 +244,10 @@ get_conn_list(struct be_req *breq, struct ad_id_ctx *ad_ctx,
struct sss_domain_info *dom, struct be_acct_req *ar)
{
struct sdap_id_conn_ctx **clist;
- int cindex = 0;
switch (ar->entry_type & BE_REQ_TYPE_MASK) {
case BE_REQ_USER: /* user */
- clist = talloc_zero_array(ad_ctx, struct sdap_id_conn_ctx *, 3);
- if (clist == NULL) return NULL;
-
- /* Try GC first for users from trusted domains */
- if (dp_opt_get_bool(ad_ctx->ad_options->basic, AD_ENABLE_GC)
- && IS_SUBDOMAIN(dom)) {
- clist[cindex] = ad_ctx->gc_ctx;
- clist[cindex]->ignore_mark_offline = true;
- cindex++;
- }
-
- /* Users from primary domain can be just downloaded from LDAP.
- * The domain's LDAP connection also works as a fallback
- */
- clist[cindex] = ad_get_dom_ldap_conn(ad_ctx, dom);
+ clist = ad_user_conn_list(breq, ad_ctx, dom);
break;
case BE_REQ_BY_SECID: /* by SID */
case BE_REQ_USER_AND_GROUP: /* get SID */
@@ -270,7 +255,6 @@ get_conn_list(struct be_req *breq, struct ad_id_ctx *ad_ctx,
case BE_REQ_INITGROUPS: /* init groups for user */
clist = ad_gc_conn_list(breq, ad_ctx, dom);
break;
-
default:
/* Requests for other object should only contact LDAP by default */
clist = ad_ldap_conn_list(breq, ad_ctx, dom);