Permalink
Browse files

Merge branch 'master' of github.com:RoryO/ruby-net-ldap

  • Loading branch information...
Austin Ziegler
Austin Ziegler committed Sep 25, 2010
2 parents 40f75e5 + 7043a24 commit f46c68dce3be545811041fb344273a9c84d372c4
Showing with 14 additions and 11 deletions.
  1. +2 −0 .gitignore
  2. +10 −10 lib/net/ldap.rb
  3. +2 −1 lib/net/ldap/pdu.rb
View
@@ -1,3 +1,5 @@
+spec/ldap.yml
+.rvmrc
*.gemspec
pkg/
*.swp
View
@@ -526,7 +526,7 @@ def get_operation_result
else
os.code = 0
end
- os.message = LDAP.result2string(os.code)
+ os.message = Net::LDAP.result2string(os.code)
os
end
@@ -1164,12 +1164,12 @@ def setup_encryption(args)
# go here.
when :start_tls
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
@conn.write request_pkt
be = @conn.read_ber(Net::LDAP::AsnSyntax)
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?
if pdu.result_code.zero?
@conn = self.class.wrap_with_ssl(@conn)
@@ -1228,7 +1228,7 @@ def bind_simple(auth)
request_pkt = [msgid, request].to_ber_sequence
@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
end
@@ -1267,7 +1267,7 @@ def bind_sasl(auth)
request_pkt = [msgid, request].to_ber_sequence
@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
raise Net::LDAP::LdapError, "sasl-challenge overflow" if ((n += 1) > MaxSaslChallenges)
@@ -1395,7 +1395,7 @@ def search(args = {})
result_code = 0
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
when 4 # search-data
n_results += 1
@@ -1472,7 +1472,7 @@ def modify(args)
pkt = [next_msgid.to_ber, request].to_ber_sequence
@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
end
@@ -1494,7 +1494,7 @@ def add(args)
pkt = [next_msgid.to_ber, request].to_ber_sequence
@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
end
@@ -1510,7 +1510,7 @@ def rename(args)
pkt = [next_msgid.to_ber, request].to_ber_sequence
@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
end
@@ -1524,7 +1524,7 @@ def delete(args)
pkt = [next_msgid.to_ber, request].to_ber_sequence
@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
end
end # class Connection
View
@@ -172,7 +172,7 @@ def parse_bind_response(sequence)
# be a good idea. Maybe this should be configurable.
def parse_search_return(sequence)
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] }
end
private :parse_search_return
@@ -247,6 +247,7 @@ def self.const_missing(name) #:nodoc:
when "LdapPduError"
warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU::Error instead."
Net::LDAP::PDU::Error
+ when 'LDAP'
else
super
end

0 comments on commit f46c68d

Please sign in to comment.