diff --git a/lib/net/ldap/connection.rb b/lib/net/ldap/connection.rb index 1f900b6e..c54667ce 100644 --- a/lib/net/ldap/connection.rb +++ b/lib/net/ldap/connection.rb @@ -379,7 +379,7 @@ def search(args = nil) # searches when the size limit is larger than 126. We're going to have # to do a root-DSE record search and not do a paged search if the LDAP # doesn't support it. Yuck. - rfc2696_cookie = [126, ""] + rfc2696_cookie = [126.to_ber, "".to_ber_bin] result_pdu = nil n_results = 0 @@ -428,7 +428,7 @@ def search(args = nil) Net::LDAP::LDAPControls::PAGED_RESULTS.to_ber, # Criticality MUST be false to interoperate with normal LDAPs. false.to_ber, - rfc2696_cookie.map(&:to_ber).to_ber_sequence.to_s.to_ber, + [rfc2696_cookie[0].to_ber, rfc2696_cookie[1].to_ber_bin].to_ber_sequence.to_s.to_ber, ].to_ber_sequence if paged controls << ber_sort if ber_sort controls = controls.empty? ? nil : controls.to_ber_contextspecific(0) @@ -494,7 +494,7 @@ def search(args = nil) if c.value and c.value.length > 0 cookie = c.value.read_ber[1] if cookie and cookie.length > 0 - rfc2696_cookie[1] = cookie + rfc2696_cookie[1] = cookie.to_ber_bin more_pages = true end end