summaryrefslogtreecommitdiffstats
path: root/src/providers/ad/ad_id.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-12-10 21:49:45 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-29 17:27:55 +0100
commite0502a6c5bc30415c372e9e6e835b94b04d5195a (patch)
tree25dd92863492fe6f5e6924daf643cfd2ec63ccf6 /src/providers/ad/ad_id.c
parent02abb93af0c81da869766c8302aecf3d08aa47e0 (diff)
downloadsssd-e0502a6c5bc30415c372e9e6e835b94b04d5195a.tar.gz
sssd-e0502a6c5bc30415c372e9e6e835b94b04d5195a.tar.xz
sssd-e0502a6c5bc30415c372e9e6e835b94b04d5195a.zip
LDAP: Pass a private context to enumeration ptask instead of hardcoded connection
Previously, the sdap-domain enumeration request used a single connection context to download all the data. Now we'd like to use different connections to download different objects, so the ID context is passed in and the request itself decides which connection to use for the sdap-domain enumeration.
Diffstat (limited to 'src/providers/ad/ad_id.c')
-rw-r--r--src/providers/ad/ad_id.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index 85edcf6d6..99383c13b 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -414,6 +414,7 @@ ad_check_online(struct be_req *be_req)
}
struct ad_enumeration_state {
+ struct ad_id_ctx *id_ctx;
struct ldap_enum_ctx *ectx;
struct sdap_id_op *sdap_op;
struct tevent_context *ev;
@@ -443,6 +444,7 @@ ad_enumeration_send(TALLOC_CTX *mem_ctx,
ectx = talloc_get_type(pvt, struct ldap_enum_ctx);
if (ectx == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot retrieve ldap_enum_ctx!\n"));
ret = EFAULT;
goto fail;
}
@@ -450,8 +452,10 @@ ad_enumeration_send(TALLOC_CTX *mem_ctx,
state->ectx = ectx;
state->ev = ev;
state->sdom = ectx->sdom;
+ state->id_ctx = talloc_get_type(ectx->pvt, struct ad_id_ctx);
- state->sdap_op = sdap_id_op_create(state, ectx->conn->conn_cache);
+ state->sdap_op = sdap_id_op_create(state,
+ state->id_ctx->ldap_ctx->conn_cache);
if (state->sdap_op == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n"));
ret = ENOMEM;
@@ -500,7 +504,7 @@ ad_enumeration_conn_done(struct tevent_req *subreq)
}
subreq = ad_master_domain_send(state, state->ev,
- state->ectx->conn,
+ state->id_ctx->ldap_ctx,
state->sdap_op,
state->sdom->dom->name);
if (subreq == NULL) {
@@ -540,8 +544,8 @@ ad_enumeration_master_done(struct tevent_req *subreq)
return;
}
- subreq = sdap_dom_enum_send(state, state->ev, state->ectx->ctx,
- state->sdom, state->ectx->conn);
+ subreq = sdap_dom_enum_send(state, state->ev, state->id_ctx->sdap_id_ctx,
+ state->sdom, state->id_ctx->ldap_ctx);
if (subreq == NULL) {
/* The ptask API will reschedule the enumeration on its own on
* failure */