summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-01-16 16:27:01 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-01-18 09:27:56 -0500
commit8270b1b8505e4bce5ec065daa8fcdf985e1fc9f5 (patch)
treed7bd59fc63e1c4f28307d82bb56cc4dedda46e04 /src/providers
parentfd3714d0cf068f3c782c1fff32105fc51cc97a0e (diff)
downloadsssd-8270b1b8505e4bce5ec065daa8fcdf985e1fc9f5.tar.gz
sssd-8270b1b8505e4bce5ec065daa8fcdf985e1fc9f5.tar.xz
sssd-8270b1b8505e4bce5ec065daa8fcdf985e1fc9f5.zip
LDAP: Add option to disable paging control
Fixes https://fedorahosted.org/sssd/ticket/967
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ipa/ipa_common.c3
-rw-r--r--src/providers/ipa/ipa_common.h2
-rw-r--r--src/providers/ldap/ldap_common.c3
-rw-r--r--src/providers/ldap/sdap.h1
-rw-r--r--src/providers/ldap/sdap_async.c8
5 files changed, 12 insertions, 5 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 12c69dd18..00231ddf3 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -106,7 +106,8 @@ struct dp_option ipa_def_ldap_opts[] = {
{ "ldap_page_size", DP_OPT_NUMBER, { .number = 1000 }, NULL_NUMBER },
{ "ldap_deref_threshold", DP_OPT_NUMBER, { .number = 10 }, NULL_NUMBER },
{ "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
- { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER }
+ { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER },
+ { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
};
struct sdap_attr_map ipa_attr_map[] = {
diff --git a/src/providers/ipa/ipa_common.h b/src/providers/ipa/ipa_common.h
index f29a238a1..238fdeea0 100644
--- a/src/providers/ipa/ipa_common.h
+++ b/src/providers/ipa/ipa_common.h
@@ -35,7 +35,7 @@ struct ipa_service {
/* the following defines are used to keep track of the options in the ldap
* module, so that if they change and ipa is not updated correspondingly
* this will trigger a runtime abort error */
-#define IPA_OPTS_BASIC_TEST 58
+#define IPA_OPTS_BASIC_TEST 59
/* the following define is used to keep track of the options in the krb5
* module, so that if they change and ipa is not updated correspondingly
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index ba94d549c..3d7f9430f 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -97,7 +97,8 @@ struct dp_option default_basic_opts[] = {
{ "ldap_page_size", DP_OPT_NUMBER, { .number = 1000 }, NULL_NUMBER },
{ "ldap_deref_threshold", DP_OPT_NUMBER, { .number = 10 }, NULL_NUMBER },
{ "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
- { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER }
+ { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER },
+ { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
};
struct sdap_attr_map generic_attr_map[] = {
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 5d6bfb827..1827d7c6e 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -207,6 +207,7 @@ enum sdap_basic_opt {
SDAP_DEREF_THRESHOLD,
SDAP_SASL_CANONICALIZE,
SDAP_EXPIRE_TIMEOUT,
+ SDAP_DISABLE_PAGING,
SDAP_OPTS_BASIC /* opts counter */
};
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 0719f74be..c2f616bef 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -978,6 +978,7 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req)
int optret;
errno_t ret;
int msgid;
+ bool disable_paging;
LDAPControl *page_control = NULL;
@@ -999,8 +1000,11 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req)
}
}
- if (sdap_is_control_supported(state->sh,
- LDAP_CONTROL_PAGEDRESULTS)) {
+ disable_paging = dp_opt_get_bool(state->opts->basic, SDAP_DISABLE_PAGING);
+
+ if (!disable_paging
+ && sdap_is_control_supported(state->sh,
+ LDAP_CONTROL_PAGEDRESULTS)) {
lret = ldap_create_page_control(state->sh->ldap,
state->sh->page_size,
state->cookie.bv_val ?