]> granicus.if.org Git - apache/commitdiff
stuff unexpected LDAP errors into ldc->reason, not just in trace messages.
authorEric Covener <covener@apache.org>
Tue, 7 Jul 2015 14:43:31 +0000 (14:43 +0000)
committerEric Covener <covener@apache.org>
Tue, 7 Jul 2015 14:43:31 +0000 (14:43 +0000)
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

modules/ldap/util_ldap.c

index ad50ea87a622c3038a4fadbe78150d13969a9564..995d6aaacd1069c794e124c0bbe0da7fd0cfcb9b 100644 (file)
@@ -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;
 }