>>> On 2/22/2007 at 7:12 AM, in message
<[EMAIL PROTECTED]>, "David Jones"
<[EMAIL PROTECTED]> wrote:
> How about something alone these lines? It assumes there is nobody with
> LDAP_DEFAULT_LIMIT undefined AND LDAP_NO_LIMIT defined, but still supports
> and wishes to use the -1 value.
>
> --- util_ldap.c.defaultlimit Wed Feb 21 16:08:51 2007
> +++ util_ldap.c.nolimit Thu Feb 15 12:50:09 2007
> @@ -52,15 +52,9 @@
> #define LDAP_CA_TYPE_BASE64 2
> #define LDAP_CA_TYPE_CERT7_DB 3
>
> -#ifdef LDAP_DEFAULT_LIMIT
> -#define LDAP_LIMIT_VALUE LDAP_DEFAULT_LIMIT
> -#else
> -#ifndef LDAP_NO_LIMIT /* Have neither LDAP_DEFAULT_LIMIT or LDAP_NO_LIMIT
> */
> -#define LDAP_LIMIT_VALUE -1
> -#else /* Have LDAP_NO_LIMIT, but not LDAP_DEFAULT_LIMIT */
> -#define LDAP_LIMIT_VALUE LDAP_NO_LIMIT
> -#endif /* !LDAP_NO_LIMIT */
> -#endif /* LDAP_DEFAULT_LIMIT */
> +#ifndef LDAP_NO_LIMIT
> +#define LDAP_NO_LIMIT -1
> +#endif
>
> module AP_MODULE_DECLARE_DATA ldap_module;
>
> @@ -680,7 +674,7 @@
> /* search for reqdn */
> if ((result = ldap_search_ext_s(ldc->ldap, (char *)reqdn,
> LDAP_SCOPE_BASE,
> "(objectclass=*)", NULL, 1,
> - NULL, NULL, NULL, LDAP_LIMIT_VALUE,
> &res))
> + NULL, NULL, NULL, LDAP_NO_LIMIT, &res))
> == LDAP_SERVER_DOWN)
> {
> ldc->reason = "DN Comparison ldap_search_ext_s() "
> @@ -958,7 +952,7 @@
> if ((result = ldap_search_ext_s(ldc->ldap,
> (char *)basedn, scope,
> (char *)filter, attrs, 0,
> - NULL, NULL, NULL, LDAP_LIMIT_VALUE,
> &res))
> + NULL, NULL, NULL, LDAP_NO_LIMIT, &res))
> == LDAP_SERVER_DOWN)
> {
> ldc->reason = "ldap_search_ext_s() for user failed with server
> down";
> @@ -1198,7 +1192,7 @@
> if ((result = ldap_search_ext_s(ldc->ldap,
> (char *)basedn, scope,
> (char *)filter, attrs, 0,
> - NULL, NULL, NULL, LDAP_LIMIT_VALUE,
> &res))
> + NULL, NULL, NULL, LDAP_NO_LIMIT, &res))
> == LDAP_SERVER_DOWN)
> {
> ldc->reason = "ldap_search_ext_s() for user failed with server
> down";
>
Maybe I missed this before, but what platform or LDAP SDK does this fail on?
The Novell LDAP SDK obviously supports LDAP_DEFAULT_SIZELIMIT (-1) and
according to the OpenLDAP source code, it also supports the same functionality
if the value of sizelimit is -1 even though it does not specifically define
LDAP_DEFAULT_SIZELIMIT. I don't know what the Netscape or Microsoft SDKs
support other than the fact that we have been passing those SDKs the same -1
value without a problem. I believe that the only reason why we see the
hardcoded -1 rather than a #define is simply because not all of the SDKs
provide a #define yet they all seems to support the functionality. We just
need to validate that theory.
Brad