summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-01-28 10:56:56 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-30 13:53:29 +0100
commit0902a4dc44a2860483f944aa34a1b07cdcfe4ee5 (patch)
tree7a896deb0ec735716fcd972fe2b19056d798bf4c /src
parent94b6d396c55da8181cbc3b515dc8945e64b2bc9b (diff)
downloadsssd-0902a4dc44a2860483f944aa34a1b07cdcfe4ee5.tar.gz
sssd-0902a4dc44a2860483f944aa34a1b07cdcfe4ee5.tar.xz
sssd-0902a4dc44a2860483f944aa34a1b07cdcfe4ee5.zip
nested groups: fix group lookup hangs if member dn is incorrectrhel-6.41.9.2-83
https://fedorahosted.org/sssd/ticket/1783 When dn in member attribute is invalid (e.g. rdn instead of dn) or it is outside of configured search bases, we might hit a situation when tevent_req is marked as done before any callback could be attached on it.
Diffstat (limited to 'src')
-rw-r--r--src/providers/ldap/sdap_async_groups.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index 556adbdec..b82c157e5 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -2519,6 +2519,11 @@ struct sdap_nested_group_ctx {
bool enable_deref;
struct sdap_deref_ctx *derefctx;
+
+ /**
+ * FIXME: Remove me!
+ */
+ bool send_finished;
};
static errno_t sdap_nested_group_process_deref_step(struct tevent_req *req);
@@ -2555,6 +2560,7 @@ static struct tevent_req *sdap_nested_group_process_send(
state->sh = sh;
state->enable_deref = enable_deref;
state->nesting_level = nesting;
+ state->send_finished = false;
/* If this is too many levels deep, just return success */
if (nesting > dp_opt_get_int(opts->basic, SDAP_NESTING_LEVEL)) {
@@ -2663,6 +2669,7 @@ static struct tevent_req *sdap_nested_group_process_send(
if (ret != EAGAIN) goto immediate;
}
+ state->send_finished = true;
return req;
immediate:
@@ -2672,6 +2679,7 @@ immediate:
tevent_req_error(req, ret);
}
tevent_req_post(req, ev);
+ state->send_finished = true;
return req;
}
@@ -3199,6 +3207,14 @@ static errno_t sdap_nested_group_lookup_user(struct tevent_req *req,
} else if (ret == EOK) {
DEBUG(SSSDBG_TRACE_FUNC, ("All done.\n"));
tevent_req_done(req);
+
+ /**
+ * FIXME: Rewrite nested group processing so we call
+ * tevent_req_post() only in _send().
+ */
+ if (state->send_finished == false) {
+ tevent_req_post(req, state->ev);
+ }
}
return EOK;
}
@@ -3255,6 +3271,14 @@ static errno_t sdap_nested_group_lookup_group(struct tevent_req *req)
} else if (ret == EOK) {
DEBUG(SSSDBG_TRACE_FUNC, ("All done.\n"));
tevent_req_done(req);
+
+ /**
+ * FIXME: Rewrite nested group processing so we call
+ * tevent_req_post() only in _send().
+ */
+ if (state->send_finished == false) {
+ tevent_req_post(req, state->ev);
+ }
}
return EOK;
}