summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcovener <covener@13f79535-47bb-0310-9956-ffa450edef68>2009-03-08 16:17:27 +0000
committercovener <covener@13f79535-47bb-0310-9956-ffa450edef68>2009-03-08 16:17:27 +0000
commit97c8d1ee540e31f273b2d59cbe6007a24daf2f66 (patch)
treebc9282fc2527ce136392874a51bef0335e97e5f4
parentd730e2f1127402b0c8deb62682753bd48538d0c1 (diff)
downloadlibapr-util-97c8d1ee540e31f273b2d59cbe6007a24daf2f66.tar.gz
It's not safe to ask an SDK that doesn't define LDAP_DEFAULT_LIMIT to
use -1, because it might put it on the wire as an unsigned int. We previously special-cased this for the MSSDK, but it needs to be more general. PR23356 git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@751456 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES5
-rw-r--r--include/apr_ldap.h.in12
-rw-r--r--include/apr_ldap.hw12
3 files changed, 21 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 3c9cc786..b361a7a2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,11 @@ Changes with APR-util 2.0.0
Changes with APR-util 1.4.0
+ *) APR_LDAP_SIZELIMIT should prefer LDAP_DEFAULT_LIMIT/-1 when the
+ SDK supports it, but in the absence of LDAP_DEFAULT_LIMIT (and
+ LDAP_NO_LIMIT/0) it is not safe to use a literal -1.
+ PR23356 [Eric Covener]
+
*) Fix apr_memcache_multgetp memory corruption and incorrect error
handling. PR 46588 [Sami Tolvanen <sami.tolvanen mywot.com>]
diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in
index c757e061..6087783d 100644
--- a/include/apr_ldap.h.in
+++ b/include/apr_ldap.h.in
@@ -102,17 +102,21 @@
/*
* For ldap function calls that input a size limit on the number of returned elements
* Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0)
+ * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK
+ * or process is configured for.
*/
-#if APR_HAS_ZOS_LDAPSDK || APR_HAS_MICROSOFT_LDAPSDK
-#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
-#else
#ifdef LDAP_DEFAULT_LIMIT
#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT
#else
-#define APR_LDAP_SIZELIMIT -1 /* equivalent to LDAP_DEFAULT_LIMIT */
+#ifdef LDAP_NO_LIMIT
+#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
#endif
#endif
+#ifndef APR_LDAP_SIZELIMIT
+#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */
+#endif
+
/*
* z/OS is missing some defines
*/
diff --git a/include/apr_ldap.hw b/include/apr_ldap.hw
index a5893764..c1bd0d4b 100644
--- a/include/apr_ldap.hw
+++ b/include/apr_ldap.hw
@@ -102,17 +102,21 @@
/*
* For ldap function calls that input a size limit on the number of returned elements
* Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0)
+ * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK
+ * or process is configured for.
*/
-#if APR_HAS_ZOS_LDAPSDK || APR_HAS_MICROSOFT_LDAPSDK
-#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
-#else
#ifdef LDAP_DEFAULT_LIMIT
#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT
#else
-#define APR_LDAP_SIZELIMIT -1 /* equivalent to LDAP_DEFAULT_LIMIT */
+#ifdef LDAP_NO_LIMIT
+#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
#endif
#endif
+#ifndef APR_LDAP_SIZELIMIT
+#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */
+#endif
+
/*
* z/OS is missing some defines
*/