Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #26 from ManageIQ/continuation-reference-processing

Added Continuation Reference Processing as defined in section 4.5.3 of RFC 2251 (http://www.ietf.org/rfc/rfc2251.txt)
  • Loading branch information...
commit 76a81cce4ad62d7e7594b2e0b033474e83276295 2 parents a1bf790 + 8a106ca
@RoryO RoryO authored
Showing with 9 additions and 0 deletions.
  1. +8 −0 lib/net/ldap.rb
  2. +1 −0  lib/net/ldap/pdu.rb
View
8 lib/net/ldap.rb
@@ -317,6 +317,7 @@ class LdapError < StandardError; end
2 => "Protocol Error",
3 => "Time Limit Exceeded",
4 => "Size Limit Exceeded",
+ 10 => "Referral",
12 => "Unavailable crtical extension",
14 => "saslBindInProgress",
16 => "No Such Attribute",
@@ -1418,6 +1419,13 @@ def search(args = {})
when 5 # search-result
result_code = pdu.result_code
controls = pdu.result_controls
+ if return_referrals && result_code == 10
+ if block_given?
+ se = Net::LDAP::Entry.new
+ se[:search_referrals] = (pdu.search_referrals || [])
+ yield se
+ end
+ end
break
else
raise Net::LDAP::LdapError, "invalid response-type in search: #{pdu.app_tag}"
View
1  lib/net/ldap/pdu.rb
@@ -136,6 +136,7 @@ def parse_ldap_result(sequence)
:matchedDN => sequence[1],
:errorMessage => sequence[2]
}
+ parse_search_referral(sequence[3]) if @ldap_result[:resultCode] == 10
end
private :parse_ldap_result
Please sign in to comment.
Something went wrong with that request. Please try again.