]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_ldap: In some case, LDAP_NO_SUCH_ATTRIBUTE could be returned instead of
authorEric Covener <covener@apache.org>
Sun, 28 Jun 2015 00:56:09 +0000 (00:56 +0000)
committerEric Covener <covener@apache.org>
Sun, 28 Jun 2015 00:56:09 +0000 (00:56 +0000)
   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

CHANGES
modules/ldap/util_ldap.c

diff --git a/CHANGES b/CHANGES
index 10d626c0138941dfd205955becb2f91a858714cc..657d7f22a528b609a1d0ad16f8aa2a8fe8faf72a 100644 (file)
--- 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]
index f5a6d85b085652df04b2a9e826ef4cbf94b3f2c7..ad50ea87a622c3038a4fadbe78150d13969a9564 100644 (file)
@@ -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;
 }