diff -ru httpd-2.2.4/include/util_ldap.h httpd-2.2.4.new/include/util_ldap.h --- httpd-2.2.4/include/util_ldap.h 2007-05-31 16:52:41.000000000 +0200 +++ httpd-2.2.4.new/include/util_ldap.h 2007-05-31 16:51:02.000000000 +0200 @@ -105,7 +105,7 @@ struct util_ldap_connection_t *next; } util_ldap_connection_t; -/* LDAP cache state information */ +/* LDAP cache state information */ typedef struct util_ldap_state_t { apr_pool_t *pool; /* pool from which this state is allocated */ #if APR_HAS_THREADS @@ -137,6 +137,7 @@ char *lock_file; /* filename for shm lock mutex */ long connectionTimeout; int verify_svr_cert; + int chase_referrals; } util_ldap_state_t; diff -ru httpd-2.2.4/modules/ldap/util_ldap.c httpd-2.2.4.new/modules/ldap/util_ldap.c --- httpd-2.2.4/modules/ldap/util_ldap.c 2007-05-31 16:52:41.000000000 +0200 +++ httpd-2.2.4.new/modules/ldap/util_ldap.c 2007-05-31 17:36:44.000000000 +0200 @@ -241,6 +241,9 @@ /* always default to LDAP V3 */ ldap_set_option(ldc->ldap, LDAP_OPT_PROTOCOL_VERSION, &version); + /* referrals */ + ldap_set_option(ldc->ldap, LDAP_OPT_REFERRALS, st->chase_referrals ? LDAP_OPT_ON : LDAP_OPT_OFF); + /* set client certificates */ if (!apr_is_empty_array(ldc->client_certs)) { apr_ldap_set_option(ldc->pool, ldc->ldap, APR_LDAP_OPT_TLS_CERT, @@ -865,6 +868,7 @@ util_search_node_t the_search_node; apr_time_t curtime; + util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(r->server->module_config, &ldap_module); @@ -1735,6 +1739,29 @@ } +static const char *util_ldap_set_chase_referrals(cmd_parms *cmd, + void *dummy, + int mode) +{ + util_ldap_state_t *st = + (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, + &ldap_module); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + + if (err != NULL) { + return err; + } + + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, + "LDAP: chase referrals - %s", + mode?"TRUE":"FALSE"); + + st->chase_referrals = mode; + + return(NULL); +} + + static const char *util_ldap_set_connection_timeout(cmd_parms *cmd, void *dummy, const char *ttl) @@ -1790,7 +1817,7 @@ st->secure_set = 0; st->connectionTimeout = 10; st->verify_svr_cert = 1; - + st->chase_referrals = 1; return st; } @@ -2087,6 +2114,10 @@ "Specify the LDAP socket connection timeout in seconds " "(default: 10)"), + AP_INIT_FLAG("LDAPChaseReferrals", util_ldap_set_chase_referrals, + NULL, RSRC_CONF, + "Set to 'ON' requires that LDAP referrals are searched. Default 'ON'"), + {NULL} };