From b35da26911249aa48052655eef02f16e12930cf9 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 25 Apr 2011 14:17:45 -0400 Subject: Add ldap_page_size configuration option --- src/providers/ldap/ldap_common.c | 3 ++- src/providers/ldap/sdap.h | 2 ++ src/providers/ldap/sdap_async.c | 3 +-- src/providers/ldap/sdap_async_connection.c | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/providers/ldap') 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) { -- cgit