You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by co...@apache.org on 2009/03/08 17:17:27 UTC

svn commit: r751456 - in /apr/apr-util/trunk: CHANGES include/apr_ldap.h.in include/apr_ldap.hw

Author: covener
Date: Sun Mar  8 16:17:27 2009
New Revision: 751456

URL: http://svn.apache.org/viewvc?rev=751456&view=rev
Log:
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


Modified:
    apr/apr-util/trunk/CHANGES
    apr/apr-util/trunk/include/apr_ldap.h.in
    apr/apr-util/trunk/include/apr_ldap.hw

Modified: apr/apr-util/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/CHANGES?rev=751456&r1=751455&r2=751456&view=diff
==============================================================================
--- apr/apr-util/trunk/CHANGES [utf-8] (original)
+++ apr/apr-util/trunk/CHANGES [utf-8] Sun Mar  8 16:17:27 2009
@@ -3,6 +3,11 @@
 
 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>]
 

Modified: apr/apr-util/trunk/include/apr_ldap.h.in
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_ldap.h.in?rev=751456&r1=751455&r2=751456&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_ldap.h.in (original)
+++ apr/apr-util/trunk/include/apr_ldap.h.in Sun Mar  8 16:17:27 2009
@@ -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
  */

Modified: apr/apr-util/trunk/include/apr_ldap.hw
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_ldap.hw?rev=751456&r1=751455&r2=751456&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_ldap.hw (original)
+++ apr/apr-util/trunk/include/apr_ldap.hw Sun Mar  8 16:17:27 2009
@@ -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
  */