summaryrefslogtreecommitdiff
path: root/modules/ldap
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2015-08-02 00:19:16 +0200
committerStefan Fritsch <sf@sfritsch.de>2015-08-02 00:19:16 +0200
commit48802c25dc82a8b13ac351c0c2137ef748256bbd (patch)
treedcaa03f7f34153303fe5afbc9c99dbb8c44b22b3 /modules/ldap
parent080d5e16db802902200a9ce5b6c40f8f1fdc1f73 (diff)
downloadapache2-48802c25dc82a8b13ac351c0c2137ef748256bbd.tar.gz
Imported Upstream version 2.4.16
Diffstat (limited to 'modules/ldap')
-rw-r--r--modules/ldap/util_ldap.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c
index 7440d9eb..156e131d 100644
--- a/modules/ldap/util_ldap.c
+++ b/modules/ldap/util_ldap.c
@@ -163,10 +163,11 @@ static void uldap_connection_close(util_ldap_connection_t *ldc)
/* mark our connection as available for reuse */
ldc->freed = apr_time_now();
ldc->r = NULL;
+ }
+
#if APR_HAS_THREADS
- apr_thread_mutex_unlock(ldc->lock);
+ apr_thread_mutex_unlock(ldc->lock);
#endif
- }
}
@@ -374,7 +375,7 @@ static int uldap_connection_init(request_rec *r,
if (ldc->ChaseReferrals != AP_LDAP_CHASEREFERRALS_SDKDEFAULT) {
/* Set options for rebind and referrals. */
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, APLOGNO(01278)
+ ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, r->server, APLOGNO(01278)
"LDAP: Setting referrals to %s.",
((ldc->ChaseReferrals == AP_LDAP_CHASEREFERRALS_ON) ? "On" : "Off"));
apr_ldap_set_option(r->pool, ldc->ldap,
@@ -1095,13 +1096,19 @@ static int uldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc,
ldc->reason = "Comparison no such attribute (cached)";
}
else {
- ldc->reason = "Comparison undefined (cached)";
+ ldc->reason = apr_psprintf(r->pool,
+ "Comparison undefined: (%d): %s (adding to cache)",
+ result, ldap_err2string(result));
}
/* record the result code to return with the reason... */
result = compare_nodep->result;
/* and unlock this read lock */
LDAP_CACHE_UNLOCK();
+
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
+ "ldap_compare_s(%pp, %s, %s, %s) = %s (cached)",
+ ldc->ldap, dn, attrib, value, ldap_err2string(result));
return result;
}
}
@@ -1185,19 +1192,26 @@ start_over:
}
LDAP_CACHE_UNLOCK();
}
+
if (LDAP_COMPARE_TRUE == result) {
ldc->reason = "Comparison true (adding to cache)";
- return LDAP_COMPARE_TRUE;
}
else if (LDAP_COMPARE_FALSE == result) {
ldc->reason = "Comparison false (adding to cache)";
- return LDAP_COMPARE_FALSE;
}
- else {
+ else if (LDAP_NO_SUCH_ATTRIBUTE == result) {
ldc->reason = "Comparison no such attribute (adding to cache)";
- return LDAP_NO_SUCH_ATTRIBUTE;
+ }
+ else {
+ ldc->reason = apr_psprintf(r->pool,
+ "Comparison undefined: (%d): %s (adding to cache)",
+ result, ldap_err2string(result));
}
}
+
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
+ "ldap_compare_s(%pp, %s, %s, %s) = %s",
+ ldc->ldap, dn, attrib, value, ldap_err2string(result));
return result;
}
@@ -2717,8 +2731,8 @@ static const char *util_ldap_set_op_timeout(cmd_parms *cmd,
}
static const char *util_ldap_set_conn_ttl(cmd_parms *cmd,
- void *dummy,
- const char *val)
+ void *dummy,
+ const char *val)
{
apr_interval_time_t timeout;
util_ldap_state_t *st =
@@ -2726,19 +2740,20 @@ static const char *util_ldap_set_conn_ttl(cmd_parms *cmd,
&ldap_module);
if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS) {
- return "LDAPConnPoolTTL has wrong format";
+ return "LDAPConnectionPoolTTL has wrong format";
}
if (timeout < 0) {
/* reserve -1 for default value */
- timeout = AP_LDAP_CONNPOOL_INFINITE;
+ timeout = AP_LDAP_CONNPOOL_INFINITE;
}
st->connection_pool_ttl = timeout;
return NULL;
}
+
static const char *util_ldap_set_retry_delay(cmd_parms *cmd,
- void *dummy,
- const char *val)
+ void *dummy,
+ const char *val)
{
apr_interval_time_t timeout;
util_ldap_state_t *st =
@@ -2763,8 +2778,8 @@ static const char *util_ldap_set_retry_delay(cmd_parms *cmd,
}
static const char *util_ldap_set_retries(cmd_parms *cmd,
- void *dummy,
- const char *val)
+ void *dummy,
+ const char *val)
{
util_ldap_state_t *st =
(util_ldap_state_t *)ap_get_module_config(cmd->server->module_config,