From: Eric Covener Date: Tue, 7 Jul 2015 14:43:31 +0000 (+0000) Subject: stuff unexpected LDAP errors into ldc->reason, not just in trace messages. X-Git-Tag: 2.5.0-alpha~3017 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57acd8e40ed5dfb8a0540131636a370c67859496;p=apache stuff unexpected LDAP errors into ldc->reason, not just in trace messages. fix some enormously long lines introduced recently. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1689694 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index ad50ea87a6..995d6aaacd 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -1097,7 +1097,9 @@ 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... */ @@ -1105,7 +1107,9 @@ static int uldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, /* 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)); + 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; } } @@ -1200,11 +1204,16 @@ start_over: ldc->reason = "Comparison no such attribute (adding to cache)"; } else { + ldc->reason = apr_psprintf(r->pool, + "Comparison undefined: (%d): %s (adding to cache)", + result, ldap_err2string(result)); ldc->reason = "Comparison undefined (adding to cache)"; } } - 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)); + 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; }