--- util_ldap.c.orig 2005-09-23 09:20:22.000000000 -0500 +++ util_ldap.c 2006-02-02 11:20:11.000000000 -0600 @@ -48,6 +48,12 @@ #define UTIL_LDAP_SET_MUTEX_PERMS #endif +#if APR_HAS_MICROSOFT_LDAPSDK +#define LDAP_SIZE_LIMIT 2147483647 +#else +#define LDAP_SIZE_LIMIT -1 +#endif + /* defines for certificate file types */ #define LDAP_CA_TYPE_UNKNOWN 0 @@ -583,7 +589,7 @@ /* search for reqdn */ if ((result = ldap_search_ext_s(ldc->ldap, const_cast(reqdn), LDAP_SCOPE_BASE, "(objectclass=*)", NULL, 1, - NULL, NULL, NULL, -1, &res)) == LDAP_SERVER_DOWN) { + NULL, NULL, NULL, LDAP_SIZE_LIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "DN Comparison ldap_search_ext_s() failed with server down"; util_ldap_connection_unbind(ldc); goto start_over; @@ -847,7 +853,7 @@ if ((result = ldap_search_ext_s(ldc->ldap, const_cast(basedn), scope, const_cast(filter), attrs, 0, - NULL, NULL, NULL, -1, &res)) == LDAP_SERVER_DOWN) { + NULL, NULL, NULL, LDAP_SIZE_LIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "ldap_search_ext_s() for user failed with server down"; util_ldap_connection_unbind(ldc); goto start_over; @@ -1077,7 +1083,7 @@ if ((result = ldap_search_ext_s(ldc->ldap, const_cast(basedn), scope, const_cast(filter), attrs, 0, - NULL, NULL, NULL, -1, &res)) == LDAP_SERVER_DOWN) { + NULL, NULL, NULL, LDAP_SIZE_LIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "ldap_search_ext_s() for user failed with server down"; util_ldap_connection_unbind(ldc); goto start_over;