summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-04-25 14:17:45 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-04-27 11:47:24 -0400
commitb35da26911249aa48052655eef02f16e12930cf9 (patch)
tree88ed5da63497f980468dbffcad3a7db54382eec0 /src/providers/ldap
parent5ed0e9f015a9948530292918dce7b8d46dcd0d6b (diff)
downloadsssd-b35da26911249aa48052655eef02f16e12930cf9.tar.gz
sssd-b35da26911249aa48052655eef02f16e12930cf9.tar.xz
sssd-b35da26911249aa48052655eef02f16e12930cf9.zip
Add ldap_page_size configuration option
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/ldap_common.c3
-rw-r--r--src/providers/ldap/sdap.h2
-rw-r--r--src/providers/ldap/sdap_async.c3
-rw-r--r--src/providers/ldap/sdap_async_connection.c4
4 files changed, 9 insertions, 3 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 11c4491f9..12028b013 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -86,7 +86,8 @@ struct dp_option default_basic_opts[] = {
/* Do not include ldap_auth_disable_tls_never_use_in_production in the
* manpages or SSSDConfig API
*/
- { "ldap_auth_disable_tls_never_use_in_production", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
+ { "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 }
};
struct sdap_attr_map generic_attr_map[] = {
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index c06b8a3b7..0f6b75504 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -77,6 +77,7 @@ struct sdap_handle {
bool connected;
/* Authentication ticket expiration time (if any) */
time_t expire_time;
+ ber_int_t page_size;
struct sdap_fd_events *sdap_fd_events;
@@ -192,6 +193,7 @@ enum sdap_basic_opt {
SDAP_CHPASS_DNS_SERVICE_NAME,
SDAP_ENUM_SEARCH_TIMEOUT,
SDAP_DISABLE_AUTH_TLS,
+ SDAP_PAGE_SIZE,
SDAP_OPTS_BASIC /* opts counter */
};
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index ebb68cf68..5e05cb742 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -880,7 +880,6 @@ static errno_t sdap_get_generic_step(struct tevent_req *req)
errno_t ret;
int msgid;
- ber_int_t page_size = 1000;
LDAPControl *page_control = NULL;
LDAPControl *m_controls[2] = { NULL, NULL };
@@ -905,7 +904,7 @@ static errno_t sdap_get_generic_step(struct tevent_req *req)
if (sdap_is_control_supported(state->sh,
LDAP_CONTROL_PAGEDRESULTS)) {
lret = ldap_create_page_control(state->sh->ldap,
- page_size,
+ state->sh->page_size,
state->cookie.bv_val ?
&state->cookie :
NULL,
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 500e5f886..40ed585c6 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -108,6 +108,10 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx,
talloc_zfree(req);
return NULL;
}
+
+ state->sh->page_size = dp_opt_get_int(state->opts->basic,
+ SDAP_PAGE_SIZE);
+
/* Initialize LDAP handler */
lret = ldap_initialize(&state->sh->ldap, uri);
if (lret != LDAP_SUCCESS) {