From 5fea59a42aa8284a16d4e76cb71dd435773221d1 Mon Sep 17 00:00:00 2001 From: blackhedd Date: Sat, 10 Jun 2006 03:25:08 +0000 Subject: [PATCH] fixed a regression caused by the introduction of RFC-2696 paged-result controls. These broke openLDAP versions 2.2.x and greater because we were using a page size of 739, while openLDAP doesn't like anything bigger than 126. --- lib/net/ldap.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index 1170c97..1eaa8a4 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -907,7 +907,11 @@ module Net scope = args[:scope] || Net::LDAP::SearchScope_WholeSubtree raise LdapError.new( "invalid search scope" ) unless SearchScopes.include?(scope) - rfc2696_cookie = [739, ""] # size-limit is a funky number so we can distinguish it from errors. + # An interesting value for the size limit would be close to A/D's built-in + # page limit of 1000 records, but openLDAP newer than version 2.2.0 chokes + # on anything bigger than 126. You get a silent error that is easily visible + # by running slapd in debug mode. Go figure. + rfc2696_cookie = [126, ""] result_code = 0 loop {