summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-08-19 18:06:41 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-09-06 14:25:36 -0400
commit9b5c5f041e92802aa074037d283674cb6eca1a23 (patch)
tree1b9a8b2e2d0a2bee3cf66554d2fef83116dd91bd
parentf1828234a850dd28465425248a83a993f262918f (diff)
downloadsssd-9b5c5f041e92802aa074037d283674cb6eca1a23.tar.gz
sssd-9b5c5f041e92802aa074037d283674cb6eca1a23.tar.xz
sssd-9b5c5f041e92802aa074037d283674cb6eca1a23.zip
Allow turning dereference off by setting the threshold to 0
-rw-r--r--src/man/sssd-ldap.5.xml4
-rw-r--r--src/providers/ldap/sdap_async.c8
-rw-r--r--src/providers/ldap/sdap_async.h2
-rw-r--r--src/providers/ldap/sdap_async_groups.c2
4 files changed, 13 insertions, 3 deletions
diff --git a/src/man/sssd-ldap.5.xml b/src/man/sssd-ldap.5.xml
index be1d333a5..2e374ea12 100644
--- a/src/man/sssd-ldap.5.xml
+++ b/src/man/sssd-ldap.5.xml
@@ -934,6 +934,10 @@
they are looked up individually.
</para>
<para>
+ You can turn off dereference lookups completely by
+ setting the value to 0.
+ </para>
+ <para>
A dereference lookup is a means of fetching all
group members in a single LDAP call.
Different LDAP servers may implement different
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index c3fe2ac5f..2edc7597c 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1819,13 +1819,19 @@ int sdap_deref_search_recv(struct tevent_req *req,
return EOK;
}
-bool sdap_has_deref_support(struct sdap_handle *sh)
+bool sdap_has_deref_support(struct sdap_handle *sh, struct sdap_options *opts)
{
const char *deref_oids[][2] = { { LDAP_SERVER_ASQ_OID, "ASQ" },
{ LDAP_CONTROL_X_DEREF, "OpenLDAP" },
{ NULL, NULL }
};
int i;
+ int deref_threshold;
+
+ deref_threshold = dp_opt_get_int(opts->basic, SDAP_DEREF_THRESHOLD);
+ if (deref_threshold == 0) {
+ return false;
+ }
for (i=0; deref_oids[i][0]; i++) {
if (sdap_is_control_supported(sh, deref_oids[i][0])) {
diff --git a/src/providers/ldap/sdap_async.h b/src/providers/ldap/sdap_async.h
index 4115f621e..9b5a30797 100644
--- a/src/providers/ldap/sdap_async.h
+++ b/src/providers/ldap/sdap_async.h
@@ -152,7 +152,7 @@ int sdap_get_generic_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx, size_t *reply_count,
struct sysdb_attrs ***reply_list);
-bool sdap_has_deref_support(struct sdap_handle *sh);
+bool sdap_has_deref_support(struct sdap_handle *sh, struct sdap_options *opts);
struct tevent_req *
sdap_deref_search_send(TALLOC_CTX *memctx,
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index b3f6bb707..f887651d9 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -1751,7 +1751,7 @@ static struct tevent_req *sdap_nested_group_process_send(
state->member_index = 0;
- if (sdap_has_deref_support(state->sh)) {
+ if (sdap_has_deref_support(state->sh, state->opts)) {
state->derefctx = talloc_zero(state, struct sdap_deref_ctx);
if (!state->derefctx) goto immediate;