From d778139d75c6733466da4e438ebba897eb1851a1 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Sun, 11 Jul 2010 12:13:28 +0800 Subject: [PATCH 1/6] Net::LdapPdu -> Net::LDAP::PDU. --- lib/net/ldap.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index 8896d28..f75c214 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -1170,12 +1170,12 @@ class Net::LDAP::Connection #:nodoc: # go here. when :start_tls msgid = next_msgid.to_ber - request = [StartTlsOid.to_ber].to_ber_appsequence(Net::LdapPdu::ExtendedRequest) + request = [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) @@ -1234,7 +1234,7 @@ class Net::LDAP::Connection #:nodoc: 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 @@ -1273,7 +1273,7 @@ class Net::LDAP::Connection #:nodoc: 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) @@ -1401,7 +1401,7 @@ class Net::LDAP::Connection #:nodoc: 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 @@ -1478,7 +1478,7 @@ class Net::LDAP::Connection #:nodoc: 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 @@ -1500,7 +1500,7 @@ class Net::LDAP::Connection #:nodoc: 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 @@ -1516,7 +1516,7 @@ class Net::LDAP::Connection #:nodoc: 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 @@ -1530,7 +1530,7 @@ class Net::LDAP::Connection #:nodoc: 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 From 4159643c3d7e657ab50e63485e42e49111f02ae0 Mon Sep 17 00:00:00 2001 From: Derek Harmel Date: Sat, 14 Aug 2010 05:09:50 +0800 Subject: [PATCH 2/6] Fixes for mysterious 'constant not missing' errors --- lib/net/ldap/pdu.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net/ldap/pdu.rb b/lib/net/ldap/pdu.rb index fc94025..e5c1352 100644 --- a/lib/net/ldap/pdu.rb +++ b/lib/net/ldap/pdu.rb @@ -196,7 +196,7 @@ class Net::LDAP::PDU # 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 @@ -270,6 +270,7 @@ module Net when "LdapPduError" warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU::Error instead." Net::LDAP::PDU::Error + when 'LDAP' else super end From 09e6267fdd3ab5dad05e37a8f90a547e2126afc7 Mon Sep 17 00:00:00 2001 From: Erik Hetzner Date: Tue, 21 Sep 2010 07:04:54 +0800 Subject: [PATCH 3/6] Fix reference to StartTlsOid constant. --- lib/net/ldap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index f75c214..5b3c747 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -1170,7 +1170,7 @@ class Net::LDAP::Connection #:nodoc: # go here. when :start_tls msgid = next_msgid.to_ber - request = [StartTlsOid.to_ber].to_ber_appsequence(Net::LDAP::PDU::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) From 85a137c71fa430d1b0c2a867963aaa77e9bf61aa Mon Sep 17 00:00:00 2001 From: Erik Hetzner Date: Tue, 21 Sep 2010 07:27:29 +0800 Subject: [PATCH 4/6] Fix reference to Net::LDAP (make absolute). --- lib/net/ldap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index 5b3c747..3fdcc22 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -532,7 +532,7 @@ class Net::LDAP else os.code = 0 end - os.message = LDAP.result2string(os.code) + os.message = Net::LDAP.result2string(os.code) os end From 41b73418f7c4bfc085a497df50bd20cb82b1c149 Mon Sep 17 00:00:00 2001 From: Kaspar Schiess Date: Fri, 24 Sep 2010 15:45:51 +0200 Subject: [PATCH 5/6] . ignore rvmrc --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 818adaa..9880bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.rvmrc *.gemspec pkg/ *.swp From 7043a24222dae45cac69e16c7d2a335c0257859c Mon Sep 17 00:00:00 2001 From: Kaspar Schiess Date: Fri, 24 Sep 2010 15:46:06 +0200 Subject: [PATCH 6/6] . ignore config file - use template --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9880bc9..a323762 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +spec/ldap.yml .rvmrc *.gemspec pkg/