From: Eric Covener Date: Sun, 28 Jun 2015 00:56:09 +0000 (+0000) Subject: *) mod_ldap: In some case, LDAP_NO_SUCH_ATTRIBUTE could be returned instead of X-Git-Tag: 2.5.0-alpha~3044 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=393b02c535c397e93f430d32384f23e93144e20e;p=thirdparty%2Fapache%2Fhttpd.git *) mod_ldap: In some case, LDAP_NO_SUCH_ATTRIBUTE could be returned instead of an error during a compare operation. [Eric Covener] + accompanying trace. Note: the if/else now matches (don't replace unknown compare errors with LDAP_NO_SUCH_ATTRIBUTE) the logic just above when pulling comparisons out of the cache. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1687980 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 10d626c0138..657d7f22a52 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_ldap: In some case, LDAP_NO_SUCH_ATTRIBUTE could be returned instead of + an error during a compare operation. [Eric Covener] + *) mod_alias: Limit Redirect expressions to directory (Location) context and redirect statuses (implicit or explicit). [Yann Ylavic, Ruediger Pluem] diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index f5a6d85b085..ad50ea87a62 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -1104,6 +1104,8 @@ static int uldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, 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; } } @@ -1187,19 +1189,22 @@ 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 = "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)); return result; }