diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:22 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:22 +0100 |
commit | 0268977037115539ad65a26e858aa0df8d18cd13 (patch) | |
tree | f761b541b04d08b75e32efc6c293111c61a8b79c /modules/ldap | |
parent | 9e615cb6aa4afcee97f8a1646e5a586261a7b81f (diff) | |
download | apache2-0268977037115539ad65a26e858aa0df8d18cd13.tar.gz |
Upstream tarball 2.2.9upstream/2.2.9
Diffstat (limited to 'modules/ldap')
-rw-r--r-- | modules/ldap/README.ldap | 2 | ||||
-rw-r--r-- | modules/ldap/config.m4 | 5 | ||||
-rw-r--r-- | modules/ldap/util_ldap.c | 20 |
3 files changed, 15 insertions, 12 deletions
diff --git a/modules/ldap/README.ldap b/modules/ldap/README.ldap index 30ec5cc7..116707e0 100644 --- a/modules/ldap/README.ldap +++ b/modules/ldap/README.ldap @@ -38,7 +38,7 @@ Quick installation instructions (win32): 3. Compile the two modules util_ldap and mod_authnz_ldap using the dsp files 4. You get a mod_authnz_ldap.so and a mod_ldap.so module 5. Put them in the modules directory, don't forget to copy the - nsldap32v50.dll somewhere where apache.exe will find it + nsldap32v50.dll somewhere where httpd.exe will find it 6. Load the two modules in your httpd.conf, like below: LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so diff --git a/modules/ldap/config.m4 b/modules/ldap/config.m4 index 25a92af4..a598d250 100644 --- a/modules/ldap/config.m4 +++ b/modules/ldap/config.m4 @@ -4,6 +4,9 @@ dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]]) APACHE_MODPATH_INIT(ldap) ldap_objects="util_ldap.lo util_ldap_cache.lo util_ldap_cache_mgr.lo" -APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , no) +APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , no, [ + MOD_LDAP_LDADD="`$apu_config --ldap-libs`" || MOD_LDAP_LDADD="" + AC_SUBST(MOD_LDAP_LDADD) +]) APACHE_MODPATH_FINISH diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 2f651931..5ea50d0a 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -212,7 +212,9 @@ static int uldap_connection_init(request_rec *r, int rc = 0, ldap_option = 0; int version = LDAP_VERSION3; apr_ldap_err_t *result = NULL; +#ifdef LDAP_OPT_NETWORK_TIMEOUT struct timeval timeOut = {10,0}; /* 10 second connection timeout */ +#endif util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(r->server->module_config, &ldap_module); @@ -923,12 +925,10 @@ static int uldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, /* ...and entry is valid */ *binddn = apr_pstrdup(r->pool, search_nodep->dn); if (attrs) { - int i = 0, k = 0; - while (attrs[k++]); - *retvals = apr_pcalloc(r->pool, sizeof(char *) * k); - while (search_nodep->vals[i]) { + int i; + *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals); + for (i = 0; i < search_nodep->numvals; i++) { (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]); - i++; } } LDAP_CACHE_UNLOCK(); @@ -1172,12 +1172,10 @@ static int uldap_cache_getuserdn(request_rec *r, util_ldap_connection_t *ldc, /* ...and entry is valid */ *binddn = apr_pstrdup(r->pool, search_nodep->dn); if (attrs) { - int i = 0, k = 0; - while (attrs[k++]); - *retvals = apr_pcalloc(r->pool, sizeof(char *) * k); - while (search_nodep->vals[i]) { + int i; + *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals); + for (i = 0; i < search_nodep->numvals; i++) { (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]); - i++; } } LDAP_CACHE_UNLOCK(); @@ -1773,9 +1771,11 @@ static const char *util_ldap_set_connection_timeout(cmd_parms *cmd, void *dummy, const char *ttl) { +#ifdef LDAP_OPT_NETWORK_TIMEOUT util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, &ldap_module); +#endif const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) { |