diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-01-16 16:27:01 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-02 19:44:31 +0200 |
commit | f0dcd98f15f7803e77bdd551956875196504e717 (patch) | |
tree | 336510d505afe6c2108cdd45749c59bdd732f3d0 | |
parent | 6ce3dcef71d0f51a20a2fa3e5ea80e3467092ea8 (diff) | |
download | sssd-f0dcd98f15f7803e77bdd551956875196504e717.tar.gz sssd-f0dcd98f15f7803e77bdd551956875196504e717.tar.xz sssd-f0dcd98f15f7803e77bdd551956875196504e717.zip |
LDAP: Add option to disable paging control
Fixes https://fedorahosted.org/sssd/ticket/967
Conflicts:
src/config/SSSDConfig.py
src/config/etc/sssd.api.d/sssd-ipa.conf
src/config/etc/sssd.api.d/sssd-ldap.conf
src/man/sssd-ldap.5.xml
src/providers/ipa/ipa_common.c
src/providers/ipa/ipa_common.h
src/providers/ldap/ldap_common.c
src/providers/ldap/sdap.h
-rw-r--r-- | src/config/SSSDConfig.py | 2 | ||||
-rw-r--r-- | src/config/etc/sssd.api.d/sssd-ipa.conf | 1 | ||||
-rw-r--r-- | src/config/etc/sssd.api.d/sssd-ldap.conf | 1 | ||||
-rw-r--r-- | src/man/sssd-ldap.5.xml | 24 | ||||
-rw-r--r-- | src/providers/ipa/ipa_common.c | 3 | ||||
-rw-r--r-- | src/providers/ipa/ipa_common.h | 2 | ||||
-rw-r--r-- | src/providers/ldap/ldap_common.c | 3 | ||||
-rw-r--r-- | src/providers/ldap/sdap.h | 1 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async.c | 8 |
9 files changed, 40 insertions, 5 deletions
diff --git a/src/config/SSSDConfig.py b/src/config/SSSDConfig.py index 2f71c7eec..a6ef63a6a 100644 --- a/src/config/SSSDConfig.py +++ b/src/config/SSSDConfig.py @@ -156,6 +156,8 @@ option_strings = { 'ldap_entry_usn' : _('entryUSN attribute'), 'ldap_rootdse_last_usn' : _('lastUSN attribute'), + 'ldap_disable_paging' : _('Disable the LDAP paging control'), + # [provider/ldap/id] 'ldap_search_timeout' : _('Length of time to wait for a search request'), 'ldap_enumeration_search_timeout' : _('Length of time to wait for a enumeration request'), diff --git a/src/config/etc/sssd.api.d/sssd-ipa.conf b/src/config/etc/sssd.api.d/sssd-ipa.conf index 1a19300a8..e79919066 100644 --- a/src/config/etc/sssd.api.d/sssd-ipa.conf +++ b/src/config/etc/sssd.api.d/sssd-ipa.conf @@ -35,6 +35,7 @@ ldap_referrals = bool, None, false ldap_krb5_ticket_lifetime = int, None, false ldap_dns_service_name = str, None, false ldap_deref = str, None, false +ldap_disable_paging = bool, None, false [provider/ipa/id] ldap_search_timeout = int, None, false diff --git a/src/config/etc/sssd.api.d/sssd-ldap.conf b/src/config/etc/sssd.api.d/sssd-ldap.conf index d84ceaed5..a386aa42d 100644 --- a/src/config/etc/sssd.api.d/sssd-ldap.conf +++ b/src/config/etc/sssd.api.d/sssd-ldap.conf @@ -29,6 +29,7 @@ ldap_dns_service_name = str, None, false ldap_deref = str, None, false ldap_page_size = int, None, false ldap_sasl_canonicalize = bool, None, false +ldap_disable_paging = bool, None, false [provider/ldap/id] ldap_search_timeout = int, None, false diff --git a/src/man/sssd-ldap.5.xml b/src/man/sssd-ldap.5.xml index 271efd4dd..e66425919 100644 --- a/src/man/sssd-ldap.5.xml +++ b/src/man/sssd-ldap.5.xml @@ -864,6 +864,30 @@ </varlistentry> <varlistentry> + <term>ldap_disable_paging</term> + <listitem> + <para> + Disable the LDAP paging control. This option + should be used if the LDAP server reports that it + supports the LDAP paging control in its RootDSE + but it is not enabled or does not behave properly. + </para> + <para> + Example: OpenLDAP servers with the paging control + module installed on the server but not enabled + will report it in the RootDSE but be unable to use + it. + </para> + <para> + Example: 389 DS has a bug where it can only + support a one paging control at a time on a single + connection. On busy clients, this can result in + some requests being denied. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term>ldap_tls_reqcert (string)</term> <listitem> <para> diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 5be1fc08b..3176e5465 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -96,7 +96,8 @@ struct dp_option ipa_def_ldap_opts[] = { */ { "ldap_auth_disable_tls_never_use_in_production", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }, { "ldap_page_size", DP_OPT_NUMBER, { .number = 1000 }, NULL_NUMBER }, - { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE } + { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }, + { "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 08a3ddef0..0bfe054b4 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 50 +#define IPA_OPTS_BASIC_TEST 51 /* 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 253cf25db..0fc61ea0a 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -87,7 +87,8 @@ struct dp_option default_basic_opts[] = { */ { "ldap_auth_disable_tls_never_use_in_production", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }, { "ldap_page_size", DP_OPT_NUMBER, { .number = 1000 }, NULL_NUMBER }, - { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE } + { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }, + { "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 44b2eab1c..ffde57a40 100644 --- a/src/providers/ldap/sdap.h +++ b/src/providers/ldap/sdap.h @@ -196,6 +196,7 @@ enum sdap_basic_opt { SDAP_DISABLE_AUTH_TLS, SDAP_PAGE_SIZE, SDAP_SASL_CANONICALIZE, + 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 3202f0152..6412666d0 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -829,6 +829,7 @@ static errno_t sdap_get_generic_step(struct tevent_req *req) int optret; errno_t ret; int msgid; + bool disable_paging; LDAPControl *page_control = NULL; LDAPControl *m_controls[2] = { NULL, NULL }; @@ -851,8 +852,11 @@ static errno_t sdap_get_generic_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 ? |