diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-08-03 07:20:47 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-08-03 07:20:47 +0000 |
commit | 6c05bf3ede7d1f2dc2542837bdb4eb865927a80a (patch) | |
tree | 645137d53d95f44af4da27eb5cb549234488eea9 | |
parent | 82bc06ff7f234f2a4720ccbb08a5d20eb362a105 (diff) |
remove --enable-paged-results configure option and now always do runtime configuration, remove nss_paged_results configfile option and use pagesize option to specify usage of paging or not
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@340 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | README | 19 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | man/nss-ldapd.conf.5.xml | 20 | ||||
-rw-r--r-- | nslcd/cfg.c | 21 | ||||
-rw-r--r-- | nslcd/cfg.h | 14 | ||||
-rw-r--r-- | nslcd/ldap-nss.c | 25 | ||||
-rw-r--r-- | nslcd/ldap-nss.h | 32 |
7 files changed, 32 insertions, 111 deletions
@@ -161,25 +161,6 @@ The last step (make install) should install the libnss_ldap.so.* file and the daemon (nslcd). The boot process needs to be manually modified to start the daemon at the right time. -paged results -------------- - -The --enable-paged-results configure option implements handling of paged -results from the LDAP server in accordance with RFC2696. - -When doing LDAP searches against a Microsoft Active Directory database, the -search results are divided into "chunks". A standard "ldap_search" against an -untweaked AD returns a maximum of 1000 entries. To get more than that, either -paging needs to be enabled or the page size needs to be increased in the -server. Enabling paging is obviously the cleaner solution. - -The page size requested is 1000 entries, and is currently not configurable. -However, this should be fine in most set-ups. - -Because of the way the page control is used, any LDAPv3 server that does not -implement paging should simply ignore it and return entries as normal; -however, this has not been fully tested yet. - CONFIGURATION ============= diff --git a/configure.ac b/configure.ac index 801571e..e69a79f 100644 --- a/configure.ac +++ b/configure.ac @@ -78,18 +78,6 @@ AC_ARG_ENABLE(warnings, [if test "x$enableval" != "no" ; then CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default -Wswitch-enum -Wfloat-equal -Wdeclaration-after-statement -Wextra -Wpointer-arith -Wbad-function-cast -Wunreachable-code -Wredundant-decls -Wredundant-decls" ; fi]) dnl -dnl --enable-paged-results is now deprecated; if this option is set, -dnl then paged results will be enabled by default. However, it can -dnl now always be enabled at runtime (as long as the underlying LDAP -dnl library supports ldap_search_ext()) with the nss_paged_results -dnl keyword. See nss_ldap(5) for more information -dnl -AC_ARG_ENABLE(paged-results, - AS_HELP_STRING([--enable-paged-results], - [use paged results control by default]), - [AC_DEFINE(PAGE_RESULTS,1,[Define to enable paged results control.])]) - -dnl dnl XXX TODO make configurable-krb5-ccname-* configurable at runtime dnl AC_ARG_ENABLE(configurable-krb5-ccname-env, diff --git a/man/nss-ldapd.conf.5.xml b/man/nss-ldapd.conf.5.xml index 3f0dbf2..404e27e 100644 --- a/man/nss-ldapd.conf.5.xml +++ b/man/nss-ldapd.conf.5.xml @@ -185,7 +185,7 @@ is used instead. </para> </listitem> - </varlistentry> + </varlistentry> <varlistentry> <term><option>rootbindpw</option> <emphasis remap="I">PASSWORD</emphasis></term> @@ -592,22 +592,16 @@ </varlistentry> <varlistentry> - <term><emphasis remap="B">nss_paged_results <yes|no></emphasis></term> - <listitem> - <para>Enables support for paged results.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><emphasis remap="B">pagesize <pagesize></emphasis></term> + <term><option>pagesize</option> <emphasis remap="I">NUMBER</emphasis></term> <listitem> - <para>When paged results are enabled (see above), specifies the number of - entries to return in a single page. The default is 1000.</para> + <para> + Set this to a number greater than 0 to enable handling of paged + results from the LDAP server in accordance with RFC2696. + The default (0) is to not request paged results. + </para> </listitem> </varlistentry> -TODO: combine the above two options - <varlistentry> <term><emphasis remap="B">nss_schema <rfc2307bis|rfc2307></emphasis></term> <listitem> diff --git a/nslcd/cfg.c b/nslcd/cfg.c index 9bfbe29..c5ad6f4 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -42,8 +42,6 @@ struct ldap_config *nslcd_cfg=NULL; -#define LDAP_PAGESIZE 1000 - /* * Timeouts for reconnecting code. Similar to rebind * logic in Darwin NetInfo. Some may find sleeping @@ -91,7 +89,6 @@ struct ldap_config *nslcd_cfg=NULL; #define NSS_LDAP_KEY_RECONNECT_MAXSLEEPTIME "nss_reconnect_maxsleeptime" #define NSS_LDAP_KEY_RECONNECT_MAXCONNTRIES "nss_reconnect_maxconntries" -#define NSS_LDAP_KEY_PAGED_RESULTS "nss_paged_results" #define NSS_LDAP_KEY_SCHEMA "nss_schema" #define NSS_LDAP_KEY_CONNECT_POLICY "nss_connect_policy" @@ -149,7 +146,7 @@ static void _nss_ldap_init_config(struct ldap_config *result) result->ldc_reconnect_pol = LP_RECONNECT_HARD_OPEN; result->ldc_sasl_secprops = NULL; result->ldc_debug = 0; - result->ldc_pagesize = LDAP_PAGESIZE; + result->ldc_pagesize = 0; #ifdef CONFIGURE_KRB5_CCNAME result->ldc_krb5_ccname = NULL; #endif /* CONFIGURE_KRB5_CCNAME */ @@ -157,9 +154,6 @@ static void _nss_ldap_init_config(struct ldap_config *result) #ifdef RFC2307BIS result->ldc_flags |= NSS_LDAP_FLAGS_RFC2307BIS; #endif /* RFC2307BIS */ -#ifdef PAGE_RESULTS - result->ldc_flags |= NSS_LDAP_FLAGS_PAGED_RESULTS; -#endif /* PAGE_RESULTS */ result->ldc_reconnect_tries = LDAP_NSS_TRIES; result->ldc_reconnect_sleeptime = LDAP_NSS_SLEEPTIME; result->ldc_reconnect_maxsleeptime = LDAP_NSS_MAXSLEEPTIME; @@ -767,19 +761,6 @@ static enum nss_status _nss_ldap_readconfig(struct ldap_config ** presult, char result->ldc_flags &= ~(NSS_LDAP_FLAGS_RFC2307BIS); } } - else if (!strcasecmp (k, NSS_LDAP_KEY_PAGED_RESULTS)) - { - if (!strcasecmp (v, "on") - || !strcasecmp (v, "yes") - || !strcasecmp (v, "true")) - { - result->ldc_flags |= NSS_LDAP_FLAGS_PAGED_RESULTS; - } - else - { - result->ldc_flags &= ~(NSS_LDAP_FLAGS_PAGED_RESULTS); - } - } else if (!strcasecmp (k, NSS_LDAP_KEY_INITGROUPS_IGNOREUSERS)) { status = do_parse_list (v, &result->ldc_initgroups_ignoreusers, diff --git a/nslcd/cfg.h b/nslcd/cfg.h index bf0689d..bff6c1a 100644 --- a/nslcd/cfg.h +++ b/nslcd/cfg.h @@ -143,23 +143,9 @@ struct ldap_config extern struct ldap_config *nslcd_cfg; /* - * There are a number of means of obtaining configuration information. - * - * (a) DHCP (Cf draft-hedstrom-dhc-ldap-00.txt) - * (b) a configuration file (/etc/ldap.conf) ** - * (c) a coldstart file & subsequent referrals from the LDAP server - * (d) a custom LDAP bind protocol - * (e) DNS ** - * - * This should be opaque to the rest of the library. - * ** implemented - */ - -/* * Flags that are exposed via _nss_ldap_test_config_flag() */ #define NSS_LDAP_FLAGS_INITGROUPS_BACKLINK 0x0001 -#define NSS_LDAP_FLAGS_PAGED_RESULTS 0x0002 #define NSS_LDAP_FLAGS_RFC2307BIS 0x0004 #define NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT 0x0008 diff --git a/nslcd/ldap-nss.c b/nslcd/ldap-nss.c index 0c5e561..a9530a8 100644 --- a/nslcd/ldap-nss.c +++ b/nslcd/ldap-nss.c @@ -116,6 +116,29 @@ static int __sigaction_retval = -1; static void (*__sigpipe_handler) (int) = SIG_DFL; #endif /* HAVE_SIGACTION */ +enum ldap_session_state +{ + LS_UNINITIALIZED = -1, + LS_INITIALIZED, + LS_CONNECTED_TO_DSA +}; + +/* + * convenient wrapper around pointer into global config list, and a + * connection to an LDAP server. + */ +struct ldap_session +{ + /* the connection */ + LDAP *ls_conn; + /* timestamp of last activity */ + time_t ls_timestamp; + /* has session been connected? */ + enum ldap_session_state ls_state; + /* index into ldc_uris: currently connected DSA */ + int ls_current_uri; +}; + /* * Global LDAP session. */ @@ -1804,7 +1827,7 @@ do_search (const char *base, int scope, log_log(LOG_DEBUG,"==> do_search"); #ifdef HAVE_LDAP_SEARCH_EXT - if (_nss_ldap_test_config_flag (NSS_LDAP_FLAGS_PAGED_RESULTS)) + if (nslcd_cfg->ldc_pagesize>0) { rc = ldap_create_page_control (__session.ls_conn, nslcd_cfg->ldc_pagesize, diff --git a/nslcd/ldap-nss.h b/nslcd/ldap-nss.h index 8c8fe9f..064057d 100644 --- a/nslcd/ldap-nss.h +++ b/nslcd/ldap-nss.h @@ -36,13 +36,8 @@ #include <time.h> #include <sys/socket.h> #include <netinet/in.h> -#ifdef HAVE_SHADOW_H -#include <shadow.h> -#endif - #include <netdb.h> #include <netinet/in.h> - #include <nss.h> #include <ldap.h> @@ -89,10 +84,6 @@ enum ldap_map_selector LM_NONE }; -/* - * POSIX profile information (not used yet) - * see draft-joslin-config-schema-00.txt - */ struct ldap_service_search_descriptor { /* search base, qualified */ @@ -105,29 +96,6 @@ struct ldap_service_search_descriptor struct ldap_service_search_descriptor *lsd_next; }; -enum ldap_session_state -{ - LS_UNINITIALIZED = -1, - LS_INITIALIZED, - LS_CONNECTED_TO_DSA -}; - -/* - * convenient wrapper around pointer into global config list, and a - * connection to an LDAP server. - */ -struct ldap_session -{ - /* the connection */ - LDAP *ls_conn; - /* timestamp of last activity */ - time_t ls_timestamp; - /* has session been connected? */ - enum ldap_session_state ls_state; - /* index into ldc_uris: currently connected DSA */ - int ls_current_uri; -}; - enum ldap_args_types { LA_TYPE_STRING, |