Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Do not add controls when it is empty. Fixed #17 #18

Merged
merged 1 commit into from

3 participants

@doitian

Some LDAP servers, such as ApacheDS, consider as invalid protocol, if controls
is an empty array.

@doitian doitian Do not add controls when it is empty. Fixed #17
Some LDAP servers, such as ApacheDS, consider as invalid protocol, if controls
is an empty array.
f102f50
@Jamstah

Can you add a test case for this change?

@RoryO RoryO merged commit a1bf790 into from
@jrafanie jrafanie referenced this pull request from a commit in jrafanie/manageiq
@jrafanie jrafanie Upgrade net-ldap for fix for LDAP Controls.
https://bugzilla.redhat.com/show_bug.cgi?id=956833

net-ping at 1.5.3 required net-ldap at ~>0.2.2, so we need to upgrade net-ping also.

See: ruby-ldap/ruby-net-ldap#18
7eb4ddf
@jrafanie jrafanie referenced this pull request in ManageIQ/manageiq
Merged

Upgrade net-ldap for fix for LDAP Controls. #505

@jrafanie jrafanie referenced this pull request from a commit in jrafanie/manageiq
@jrafanie jrafanie Upgrade net-ldap for fix for LDAP Controls.
https://bugzilla.redhat.com/show_bug.cgi?id=956833

net-ping at 1.5.3 required net-ldap at ~>0.2.2, so we need to upgrade net-ping also.

See: ruby-ldap/ruby-net-ldap#18

In upgrading from 0.2.2 to latest, 0.7.0, the change we need is here:
ruby-ldap/ruby-net-ldap@v0.2.2...v0.7.0#diff-724e0b3130dc49ca34eadc7c25d28b18R1647.
We want to be able to compact any nil control_codes.
eda440e
@martinpovolny martinpovolny referenced this pull request from a commit in martinpovolny/manageiq
@jrafanie jrafanie Upgrade net-ldap for fix for LDAP Controls.
https://bugzilla.redhat.com/show_bug.cgi?id=956833

net-ping at 1.5.3 required net-ldap at ~>0.2.2, so we need to upgrade net-ping also.

See: ruby-ldap/ruby-net-ldap#18

In upgrading from 0.2.2 to latest, 0.7.0, the change we need is here:
ruby-ldap/ruby-net-ldap@v0.2.2...v0.7.0#diff-724e0b3130dc49ca34eadc7c25d28b18R1647.
We want to be able to compact any nil control_codes.
6935d71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 10, 2011
  1. @doitian

    Do not add controls when it is empty. Fixed #17

    doitian authored
    Some LDAP servers, such as ApacheDS, consider as invalid protocol, if controls
    is an empty array.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/net/ldap.rb
View
4 lib/net/ldap.rb
@@ -1389,9 +1389,9 @@ def search(args = {})
false.to_ber,
rfc2696_cookie.map{ |v| v.to_ber}.to_ber_sequence.to_s.to_ber
].to_ber_sequence if paged_searches_supported
- controls = controls.to_ber_contextspecific(0)
+ controls = controls.empty? ? nil : controls.to_ber_contextspecific(0)
- pkt = [next_msgid.to_ber, request, controls].to_ber_sequence
+ pkt = [next_msgid.to_ber, request, controls].compact.to_ber_sequence
@conn.write pkt
result_code = 0
Something went wrong with that request. Please try again.