Merge branch 'master' of github.com:RoryO/ruby-net-ldap
This commit is contained in:
commit
f46c68dce3
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
spec/ldap.yml
|
||||||
|
.rvmrc
|
||||||
*.gemspec
|
*.gemspec
|
||||||
pkg/
|
pkg/
|
||||||
*.swp
|
*.swp
|
||||||
|
|
|
@ -526,7 +526,7 @@ class Net::LDAP
|
||||||
else
|
else
|
||||||
os.code = 0
|
os.code = 0
|
||||||
end
|
end
|
||||||
os.message = LDAP.result2string(os.code)
|
os.message = Net::LDAP.result2string(os.code)
|
||||||
os
|
os
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1164,12 +1164,12 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
# go here.
|
# go here.
|
||||||
when :start_tls
|
when :start_tls
|
||||||
msgid = next_msgid.to_ber
|
msgid = next_msgid.to_ber
|
||||||
request = [StartTlsOid.to_ber].to_ber_appsequence(Net::LdapPdu::ExtendedRequest)
|
request = [Net::LDAP::StartTlsOid.to_ber].to_ber_appsequence(Net::LDAP::PDU::ExtendedRequest)
|
||||||
request_pkt = [msgid, request].to_ber_sequence
|
request_pkt = [msgid, request].to_ber_sequence
|
||||||
@conn.write request_pkt
|
@conn.write request_pkt
|
||||||
be = @conn.read_ber(Net::LDAP::AsnSyntax)
|
be = @conn.read_ber(Net::LDAP::AsnSyntax)
|
||||||
raise Net::LDAP::LdapError, "no start_tls result" if be.nil?
|
raise Net::LDAP::LdapError, "no start_tls result" if be.nil?
|
||||||
pdu = Net::LdapPdu.new(be)
|
pdu = Net::LDAP::PDU.new(be)
|
||||||
raise Net::LDAP::LdapError, "no start_tls result" if pdu.nil?
|
raise Net::LDAP::LdapError, "no start_tls result" if pdu.nil?
|
||||||
if pdu.result_code.zero?
|
if pdu.result_code.zero?
|
||||||
@conn = self.class.wrap_with_ssl(@conn)
|
@conn = self.class.wrap_with_ssl(@conn)
|
||||||
|
@ -1228,7 +1228,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
request_pkt = [msgid, request].to_ber_sequence
|
request_pkt = [msgid, request].to_ber_sequence
|
||||||
@conn.write request_pkt
|
@conn.write request_pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax) and pdu = Net::LdapPdu.new(be)) or raise Net::LDAP::LdapError, "no bind result"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax) and pdu = Net::LDAP::PDU.new(be)) or raise Net::LDAP::LdapError, "no bind result"
|
||||||
|
|
||||||
pdu.result_code
|
pdu.result_code
|
||||||
end
|
end
|
||||||
|
@ -1267,7 +1267,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
request_pkt = [msgid, request].to_ber_sequence
|
request_pkt = [msgid, request].to_ber_sequence
|
||||||
@conn.write request_pkt
|
@conn.write request_pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax) and pdu = Net::LdapPdu.new(be)) or raise Net::LDAP::LdapError, "no bind result"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax) and pdu = Net::LDAP::PDU.new(be)) or raise Net::LDAP::LdapError, "no bind result"
|
||||||
return pdu.result_code unless pdu.result_code == 14 # saslBindInProgress
|
return pdu.result_code unless pdu.result_code == 14 # saslBindInProgress
|
||||||
raise Net::LDAP::LdapError, "sasl-challenge overflow" if ((n += 1) > MaxSaslChallenges)
|
raise Net::LDAP::LdapError, "sasl-challenge overflow" if ((n += 1) > MaxSaslChallenges)
|
||||||
|
|
||||||
|
@ -1395,7 +1395,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
result_code = 0
|
result_code = 0
|
||||||
controls = []
|
controls = []
|
||||||
|
|
||||||
while (be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LdapPdu.new(be))
|
while (be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LDAP::PDU.new(be))
|
||||||
case pdu.app_tag
|
case pdu.app_tag
|
||||||
when 4 # search-data
|
when 4 # search-data
|
||||||
n_results += 1
|
n_results += 1
|
||||||
|
@ -1472,7 +1472,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
||||||
@conn.write pkt
|
@conn.write pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LdapPdu.new(be)) && (pdu.app_tag == 7) or raise Net::LDAP::LdapError, "response missing or invalid"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LDAP::PDU.new(be)) && (pdu.app_tag == 7) or raise Net::LDAP::LdapError, "response missing or invalid"
|
||||||
pdu.result_code
|
pdu.result_code
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1494,7 +1494,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
||||||
@conn.write pkt
|
@conn.write pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LdapPdu.new(be)) && (pdu.app_tag == 9) or raise Net::LDAP::LdapError, "response missing or invalid"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LDAP::PDU.new(be)) && (pdu.app_tag == 9) or raise Net::LDAP::LdapError, "response missing or invalid"
|
||||||
pdu.result_code
|
pdu.result_code
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1510,7 +1510,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
||||||
@conn.write pkt
|
@conn.write pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LdapPdu.new(be)) && (pdu.app_tag == 13) or raise Net::LDAP::LdapError, "response missing or invalid"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LDAP::PDU.new(be)) && (pdu.app_tag == 13) or raise Net::LDAP::LdapError, "response missing or invalid"
|
||||||
pdu.result_code
|
pdu.result_code
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1524,7 +1524,7 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
pkt = [next_msgid.to_ber, request].to_ber_sequence
|
||||||
@conn.write pkt
|
@conn.write pkt
|
||||||
|
|
||||||
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LdapPdu.new(be)) && (pdu.app_tag == 11) or raise Net::LDAP::LdapError, "response missing or invalid"
|
(be = @conn.read_ber(Net::LDAP::AsnSyntax)) && (pdu = Net::LDAP::PDU.new(be)) && (pdu.app_tag == 11) or raise Net::LDAP::LdapError, "response missing or invalid"
|
||||||
pdu.result_code
|
pdu.result_code
|
||||||
end
|
end
|
||||||
end # class Connection
|
end # class Connection
|
||||||
|
|
|
@ -172,7 +172,7 @@ class Net::LDAP::PDU
|
||||||
# be a good idea. Maybe this should be configurable.
|
# be a good idea. Maybe this should be configurable.
|
||||||
def parse_search_return(sequence)
|
def parse_search_return(sequence)
|
||||||
sequence.length >= 2 or raise Net::LDAP::PDU::Error, "Invalid Search Response length."
|
sequence.length >= 2 or raise Net::LDAP::PDU::Error, "Invalid Search Response length."
|
||||||
@search_entry = LDAP::Entry.new(sequence[0])
|
@search_entry = Net::LDAP::Entry.new(sequence[0])
|
||||||
sequence[1].each { |seq| @search_entry[seq[0]] = seq[1] }
|
sequence[1].each { |seq| @search_entry[seq[0]] = seq[1] }
|
||||||
end
|
end
|
||||||
private :parse_search_return
|
private :parse_search_return
|
||||||
|
@ -247,6 +247,7 @@ module Net
|
||||||
when "LdapPduError"
|
when "LdapPduError"
|
||||||
warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU::Error instead."
|
warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU::Error instead."
|
||||||
Net::LDAP::PDU::Error
|
Net::LDAP::PDU::Error
|
||||||
|
when 'LDAP'
|
||||||
else
|
else
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue