You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Andy Wang <aw...@ptc.com> on 2005/12/05 23:43:05 UTC

Re: Win32 Apache and ldap size limit problem.

William A. Rowe, Jr. wrote:

>
> Please clarify, this is the win32 WLDAP32.dll client to OpenLDAP 2.2
> backend ldap server (e.g. on unix or whatever), ssl/tls is not involved?
>
We tried the following code just to see if it's possible to override 
sizelimit.  It works fine with openldap as the SDK (on Unix) but it 
doesn't work for Windows.
Is there something goofy that needs to be done with the Microsoft LDAP 
library to set this option?  Even with it set, on Windows it attempts to 
send a size limit of 4294967295 instead of 10.

Andy


--- util_ldap.c.orig    2005-04-11 10:49:57.000000000 -0500
+++ util_ldap.c 2005-11-30 16:46:41.000000000 -0600
@@ -240,6 +240,7 @@
 {
     int result = 0;
     int failures = 0;
+    int sizelimit = 10;
     int version  = LDAP_VERSION3;

     util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(
@@ -311,6 +312,10 @@
             return(-1);
         }

+//        #if APR_HAS_MICROSOFT_LDAPSDK
+        ldap_set_option (ldc->ldap, LDAP_OPT_SIZELIMIT, (void 
*)&sizelimit);
+ //       #endif
+
         /* Set the alias dereferencing option */
         ldap_set_option(ldc->ldap, LDAP_OPT_DEREF, &(ldc->deref));

Re: Win32 Apache and ldap size limit problem.

Posted by Andy Wang <aw...@ptc.com>.
Filed bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=37814

Made a couple of suggestions
1) use #if's to determine if it's windows and pass in the appropriate 
sizelimit to ldap_search_ext_s on windows
2) use ldap_search_s instead of ldap_search_ext_s.  It doesn't look like 
util_ldap.c is even using any of the extended features of 
ldap_search_ext_s so why bother using it.

I'd be more than willing to create the patch if someone wants to comment 
on which solution they like more.

Andy


Andy Wang wrote:

> William A. Rowe, Jr. wrote:
>
>>
>> Please clarify, this is the win32 WLDAP32.dll client to OpenLDAP 2.2
>> backend ldap server (e.g. on unix or whatever), ssl/tls is not involved?
>>
> We tried the following code just to see if it's possible to override 
> sizelimit.  It works fine with openldap as the SDK (on Unix) but it 
> doesn't work for Windows.
> Is there something goofy that needs to be done with the Microsoft LDAP 
> library to set this option?  Even with it set, on Windows it attempts 
> to send a size limit of 4294967295 instead of 10.
>
> Andy
>
>
> --- util_ldap.c.orig    2005-04-11 10:49:57.000000000 -0500
> +++ util_ldap.c 2005-11-30 16:46:41.000000000 -0600
> @@ -240,6 +240,7 @@
> {
>     int result = 0;
>     int failures = 0;
> +    int sizelimit = 10;
>     int version  = LDAP_VERSION3;
>
>     util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(
> @@ -311,6 +312,10 @@
>             return(-1);
>         }
>
> +//        #if APR_HAS_MICROSOFT_LDAPSDK
> +        ldap_set_option (ldc->ldap, LDAP_OPT_SIZELIMIT, (void 
> *)&sizelimit);
> + //       #endif
> +
>         /* Set the alias dereferencing option */
>         ldap_set_option(ldc->ldap, LDAP_OPT_DEREF, &(ldc->deref));
>