summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-03-25 12:08:04 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-04-08 11:22:09 +0200
commit725bb2a9901c4f673b107ed179f5d68ec443ca63 (patch)
tree2e598414ac0258de574141fbb036dfae359ea1d1 /src/providers/ldap
parentd51bc5f43fffa516446ef62c2b860be9fa939c9d (diff)
downloadsssd-725bb2a9901c4f673b107ed179f5d68ec443ca63.tar.gz
sssd-725bb2a9901c4f673b107ed179f5d68ec443ca63.tar.xz
sssd-725bb2a9901c4f673b107ed179f5d68ec443ca63.zip
enumeration: fix talloc context
If for some reason ptask fails (e.g. timeout), req is talloc freed but because subreq is attached to ectx which is permanent it is finished anyway. Then a crash occures when we are trying to access callback data. The same happens in sdap_dom_enum_ex_send. Resolves: https://fedorahosted.org/sssd/ticket/2611 Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/ldap_id_enum.c2
-rw-r--r--src/providers/ldap/sdap_async_enum.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index 13d2a6254..1aec91a99 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -133,7 +133,7 @@ ldap_enumeration_send(TALLOC_CTX *mem_ctx,
state->dom = ectx->sdom->dom;
state->id_ctx = talloc_get_type_abort(ectx->pvt, struct sdap_id_ctx);
- subreq = sdap_dom_enum_send(ectx, ev, state->id_ctx, ectx->sdom,
+ subreq = sdap_dom_enum_send(state, ev, state->id_ctx, ectx->sdom,
state->id_ctx->conn);
if (subreq == NULL) {
/* The ptask API will reschedule the enumeration on its own on
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c
index 1cc09abdf..35afc55f8 100644
--- a/src/providers/ldap/sdap_async_enum.c
+++ b/src/providers/ldap/sdap_async_enum.c
@@ -91,7 +91,7 @@ sdap_dom_enum_ex_send(TALLOC_CTX *memctx,
int t;
errno_t ret;
- req = tevent_req_create(ctx, &state, struct sdap_dom_enum_ex_state);
+ req = tevent_req_create(memctx, &state, struct sdap_dom_enum_ex_state);
if (req == NULL) return NULL;
state->ev = ev;