net-ldap 0.1.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of net-ldap might be problematic. Click here for more details.
- data/.autotest +11 -0
- data/.gemtest +0 -0
- data/.rspec +2 -0
- data/Contributors.rdoc +21 -0
- data/Hacking.rdoc +68 -0
- data/{History.txt → History.rdoc} +65 -1
- data/License.rdoc +29 -0
- data/Manifest.txt +25 -14
- data/README.rdoc +52 -0
- data/Rakefile +52 -96
- data/autotest/discover.rb +1 -0
- data/lib/net-ldap.rb +1 -0
- data/lib/net/ber.rb +302 -81
- data/lib/net/ber/ber_parser.rb +153 -97
- data/lib/net/ber/core_ext.rb +62 -0
- data/lib/net/ber/core_ext/array.rb +82 -0
- data/lib/net/ber/core_ext/bignum.rb +22 -0
- data/lib/net/ber/core_ext/false_class.rb +10 -0
- data/lib/net/ber/core_ext/fixnum.rb +66 -0
- data/lib/net/ber/core_ext/string.rb +48 -0
- data/lib/net/ber/core_ext/true_class.rb +12 -0
- data/lib/net/ldap.rb +1455 -1475
- data/lib/net/ldap/dataset.rb +134 -79
- data/lib/net/ldap/dn.rb +225 -0
- data/lib/net/ldap/entry.rb +168 -249
- data/lib/net/ldap/filter.rb +654 -387
- data/lib/net/ldap/password.rb +31 -0
- data/lib/net/ldap/pdu.rb +232 -233
- data/lib/net/snmp.rb +4 -31
- data/net-ldap.gemspec +59 -0
- data/spec/integration/ssl_ber_spec.rb +3 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/unit/ber/ber_spec.rb +82 -6
- data/spec/unit/ber/core_ext/string_spec.rb +51 -0
- data/spec/unit/ldap/dn_spec.rb +80 -0
- data/spec/unit/ldap/entry_spec.rb +51 -0
- data/spec/unit/ldap/filter_spec.rb +84 -0
- data/spec/unit/ldap_spec.rb +48 -0
- data/test/test_entry.rb +54 -2
- data/test/test_filter.rb +93 -54
- data/test/test_ldap_connection.rb +24 -0
- data/test/test_ldif.rb +31 -23
- data/test/test_rename.rb +77 -0
- data/test/test_snmp.rb +34 -33
- metadata +88 -52
- data/COPYING +0 -272
- data/LICENSE +0 -56
- data/README.txt +0 -68
- data/lib/net/ldap/core_ext/all.rb +0 -43
- data/lib/net/ldap/core_ext/array.rb +0 -42
- data/lib/net/ldap/core_ext/bignum.rb +0 -25
- data/lib/net/ldap/core_ext/false_class.rb +0 -11
- data/lib/net/ldap/core_ext/fixnum.rb +0 -74
- data/lib/net/ldap/core_ext/string.rb +0 -40
- data/lib/net/ldap/core_ext/true_class.rb +0 -11
- data/lib/net/ldap/psw.rb +0 -57
- data/lib/net/ldif.rb +0 -34
- data/test/test_ber.rb +0 -78
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- ruby encoding: utf-8 -*-
|
2
|
+
require 'digest/sha1'
|
3
|
+
require 'digest/md5'
|
4
|
+
|
5
|
+
class Net::LDAP::Password
|
6
|
+
class << self
|
7
|
+
# Generate a password-hash suitable for inclusion in an LDAP attribute.
|
8
|
+
# Pass a hash type (currently supported: :md5 and :sha) and a plaintext
|
9
|
+
# password. This function will return a hashed representation.
|
10
|
+
#
|
11
|
+
#--
|
12
|
+
# STUB: This is here to fulfill the requirements of an RFC, which
|
13
|
+
# one?
|
14
|
+
#
|
15
|
+
# TODO, gotta do salted-sha and (maybe)salted-md5. Should we provide
|
16
|
+
# sha1 as a synonym for sha1? I vote no because then should you also
|
17
|
+
# provide ssha1 for symmetry?
|
18
|
+
def generate(type, str)
|
19
|
+
digest, digest_name = case type
|
20
|
+
when :md5
|
21
|
+
[Digest::MD5.new, 'MD5']
|
22
|
+
when :sha
|
23
|
+
[Digest::SHA1.new, 'SHA']
|
24
|
+
else
|
25
|
+
raise Net::LDAP::LdapError, "Unsupported password-hash type (#{type})"
|
26
|
+
end
|
27
|
+
digest << str.to_s
|
28
|
+
return "{#{digest_name}}#{[digest.digest].pack('m').chomp }"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/net/ldap/pdu.rb
CHANGED
@@ -1,257 +1,256 @@
|
|
1
|
+
# -*- ruby encoding: utf-8 -*-
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
##
|
5
|
+
# Defines the Protocol Data Unit (PDU) for LDAP. An LDAP PDU always looks
|
6
|
+
# like a BER SEQUENCE with at least two elements: an INTEGER message ID
|
7
|
+
# number and an application-specific SEQUENCE. Some LDAPv3 packets also
|
8
|
+
# include an optional third element, a sequence of "controls" (see RFC 2251
|
9
|
+
# section 4.1.12 for more information).
|
1
10
|
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#----------------------------------------------------------------------------
|
5
|
-
#
|
6
|
-
# Copyright (C) 2006 by Francis Cianfrocca. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# Gmail: garbagecat10
|
9
|
-
#
|
10
|
-
# This program is free software; you can redistribute it and/or modify
|
11
|
-
# it under the terms of the GNU General Public License as published by
|
12
|
-
# the Free Software Foundation; either version 2 of the License, or
|
13
|
-
# (at your option) any later version.
|
14
|
-
#
|
15
|
-
# This program is distributed in the hope that it will be useful,
|
16
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
-
# GNU General Public License for more details.
|
11
|
+
# The application-specific tag in the sequence tells us what kind of packet
|
12
|
+
# it is, and each kind has its own format, defined in RFC-1777.
|
19
13
|
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
14
|
+
# Observe that many clients (such as ldapsearch) do not necessarily enforce
|
15
|
+
# the expected application tags on received protocol packets. This
|
16
|
+
# implementation does interpret the RFC strictly in this regard, and it
|
17
|
+
# remains to be seen whether there are servers out there that will not work
|
18
|
+
# well with our approach.
|
23
19
|
#
|
24
|
-
|
20
|
+
# Currently, we only support controls on SearchResult.
|
21
|
+
class Net::LDAP::PDU
|
22
|
+
class Error < RuntimeError; end
|
25
23
|
|
26
|
-
|
24
|
+
##
|
25
|
+
# This message packet is a bind request.
|
26
|
+
BindRequest = 0
|
27
|
+
BindResult = 1
|
28
|
+
UnbindRequest = 2
|
29
|
+
SearchRequest = 3
|
30
|
+
SearchReturnedData = 4
|
31
|
+
SearchResult = 5
|
32
|
+
ModifyResponse = 7
|
33
|
+
AddResponse = 9
|
34
|
+
DeleteResponse = 11
|
35
|
+
ModifyRDNResponse = 13
|
36
|
+
SearchResultReferral = 19
|
37
|
+
ExtendedRequest = 23
|
38
|
+
ExtendedResponse = 24
|
27
39
|
|
28
|
-
|
29
|
-
|
40
|
+
##
|
41
|
+
# The LDAP packet message ID.
|
42
|
+
attr_reader :message_id
|
43
|
+
alias_method :msg_id, :message_id
|
30
44
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
UnbindRequest = 2
|
35
|
-
SearchRequest = 3
|
36
|
-
SearchReturnedData = 4
|
37
|
-
SearchResult = 5
|
38
|
-
ModifyResponse = 7
|
39
|
-
AddResponse = 9
|
40
|
-
DeleteResponse = 11
|
41
|
-
ModifyRDNResponse = 13
|
42
|
-
SearchResultReferral = 19
|
43
|
-
ExtendedRequest = 23
|
44
|
-
ExtendedResponse = 24
|
45
|
+
##
|
46
|
+
# The application protocol format tag.
|
47
|
+
attr_reader :app_tag
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
attr_reader :search_entry
|
50
|
+
attr_reader :search_referrals
|
51
|
+
attr_reader :search_parameters
|
52
|
+
attr_reader :bind_parameters
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# (See RFC 2251, section 4.1.12).
|
57
|
-
# The application-specific tag in the sequence tells
|
58
|
-
# us what kind of packet it is, and each kind has its
|
59
|
-
# own format, defined in RFC-1777.
|
60
|
-
# Observe that many clients (such as ldapsearch)
|
61
|
-
# do not necessarily enforce the expected application
|
62
|
-
# tags on received protocol packets. This implementation
|
63
|
-
# does interpret the RFC strictly in this regard, and
|
64
|
-
# it remains to be seen whether there are servers out
|
65
|
-
# there that will not work well with our approach.
|
66
|
-
#
|
67
|
-
# Added a controls-processor to SearchResult.
|
68
|
-
# Didn't add it everywhere because it just _feels_
|
69
|
-
# like it will need to be refactored.
|
70
|
-
#
|
71
|
-
def initialize ber_object
|
72
|
-
begin
|
73
|
-
@msg_id = ber_object[0].to_i
|
74
|
-
# Modified 25Nov06. We want to "un-decorate" the ber-identifier
|
75
|
-
# of the incoming packet. Originally we did this by subtracting 0x60,
|
76
|
-
# which ASSUMES the identifier is a constructed app-specific value.
|
77
|
-
# But at least one value (UnbindRequest) is app-specific primitive.
|
78
|
-
# So it makes more sense just to grab the bottom five bits.
|
79
|
-
#@app_tag = ber_object[1].ber_identifier - 0x60
|
80
|
-
@app_tag = ber_object[1].ber_identifier & 31
|
81
|
-
@ldap_controls = []
|
82
|
-
rescue
|
83
|
-
# any error becomes a data-format error
|
84
|
-
raise LdapPduError.new( "ldap-pdu format error" )
|
85
|
-
end
|
54
|
+
##
|
55
|
+
# Returns RFC-2251 Controls if any.
|
56
|
+
attr_reader :ldap_controls
|
57
|
+
alias_method :result_controls, :ldap_controls
|
58
|
+
# Messy. Does this functionality belong somewhere else?
|
86
59
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
when DeleteResponse
|
102
|
-
parse_ldap_result ber_object[1]
|
103
|
-
when ModifyRDNResponse
|
104
|
-
parse_ldap_result ber_object[1]
|
105
|
-
when SearchRequest
|
106
|
-
parse_ldap_search_request ber_object[1]
|
107
|
-
when BindRequest
|
108
|
-
parse_bind_request ber_object[1]
|
109
|
-
when UnbindRequest
|
110
|
-
parse_unbind_request ber_object[1]
|
111
|
-
when ExtendedResponse
|
112
|
-
parse_ldap_result ber_object[1]
|
113
|
-
else
|
114
|
-
raise LdapPduError.new( "unknown pdu-type: #{@app_tag}" )
|
115
|
-
end
|
116
|
-
end
|
60
|
+
def initialize(ber_object)
|
61
|
+
begin
|
62
|
+
@message_id = ber_object[0].to_i
|
63
|
+
# Grab the bottom five bits of the identifier so we know which type of
|
64
|
+
# PDU this is.
|
65
|
+
#
|
66
|
+
# This is safe enough in LDAP-land, but it is recommended that other
|
67
|
+
# approaches be taken for other protocols in the case that there's an
|
68
|
+
# app-specific tag that has both primitive and constructed forms.
|
69
|
+
@app_tag = ber_object[1].ber_identifier & 0x1f
|
70
|
+
@ldap_controls = []
|
71
|
+
rescue Exception => ex
|
72
|
+
raise Net::LDAP::PDU::Error, "LDAP PDU Format Error: #{ex.message}"
|
73
|
+
end
|
117
74
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
75
|
+
case @app_tag
|
76
|
+
when BindResult
|
77
|
+
parse_bind_response(ber_object[1])
|
78
|
+
when SearchReturnedData
|
79
|
+
parse_search_return(ber_object[1])
|
80
|
+
when SearchResultReferral
|
81
|
+
parse_search_referral(ber_object[1])
|
82
|
+
when SearchResult
|
83
|
+
parse_ldap_result(ber_object[1])
|
84
|
+
when ModifyResponse
|
85
|
+
parse_ldap_result(ber_object[1])
|
86
|
+
when AddResponse
|
87
|
+
parse_ldap_result(ber_object[1])
|
88
|
+
when DeleteResponse
|
89
|
+
parse_ldap_result(ber_object[1])
|
90
|
+
when ModifyRDNResponse
|
91
|
+
parse_ldap_result(ber_object[1])
|
92
|
+
when SearchRequest
|
93
|
+
parse_ldap_search_request(ber_object[1])
|
94
|
+
when BindRequest
|
95
|
+
parse_bind_request(ber_object[1])
|
96
|
+
when UnbindRequest
|
97
|
+
parse_unbind_request(ber_object[1])
|
98
|
+
when ExtendedResponse
|
99
|
+
parse_ldap_result(ber_object[1])
|
100
|
+
else
|
101
|
+
raise LdapPduError.new("unknown pdu-type: #{@app_tag}")
|
102
|
+
end
|
125
103
|
|
126
|
-
|
127
|
-
|
128
|
-
# That can easily happen depending on the type of packet.
|
129
|
-
#
|
130
|
-
def result_code code = :resultCode
|
131
|
-
@ldap_result and @ldap_result[code]
|
132
|
-
end
|
104
|
+
parse_controls(ber_object[2]) if ber_object[2]
|
105
|
+
end
|
133
106
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
107
|
+
##
|
108
|
+
# Returns a hash which (usually) defines the members :resultCode,
|
109
|
+
# :errorMessage, and :matchedDN. These values come directly from an LDAP
|
110
|
+
# response packet returned by the remote peer. Also see #result_code.
|
111
|
+
def result
|
112
|
+
@ldap_result || {}
|
113
|
+
end
|
139
114
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
115
|
+
##
|
116
|
+
# This returns an LDAP result code taken from the PDU, but it will be nil
|
117
|
+
# if there wasn't a result code. That can easily happen depending on the
|
118
|
+
# type of packet.
|
119
|
+
def result_code(code = :resultCode)
|
120
|
+
@ldap_result and @ldap_result[code]
|
121
|
+
end
|
146
122
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
123
|
+
##
|
124
|
+
# Return serverSaslCreds, which are only present in BindResponse packets.
|
125
|
+
#--
|
126
|
+
# Messy. Does this functionality belong somewhere else? We ought to
|
127
|
+
# refactor the accessors of this class before they get any kludgier.
|
128
|
+
def result_server_sasl_creds
|
129
|
+
@ldap_result && @ldap_result[:serverSaslCreds]
|
130
|
+
end
|
153
131
|
|
154
|
-
|
132
|
+
def parse_ldap_result(sequence)
|
133
|
+
sequence.length >= 3 or raise Net::LDAP::PDU::Error, "Invalid LDAP result length."
|
134
|
+
@ldap_result = {
|
135
|
+
:resultCode => sequence[0],
|
136
|
+
:matchedDN => sequence[1],
|
137
|
+
:errorMessage => sequence[2]
|
138
|
+
}
|
139
|
+
end
|
140
|
+
private :parse_ldap_result
|
155
141
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
142
|
+
##
|
143
|
+
# A Bind Response may have an additional field, ID [7], serverSaslCreds,
|
144
|
+
# per RFC 2251 pgh 4.2.3.
|
145
|
+
def parse_bind_response(sequence)
|
146
|
+
sequence.length >= 3 or raise Net::LDAP::PDU::Error, "Invalid LDAP Bind Response length."
|
147
|
+
parse_ldap_result(sequence)
|
148
|
+
@ldap_result[:serverSaslCreds] = sequence[3] if sequence.length >= 4
|
149
|
+
@ldap_result
|
150
|
+
end
|
151
|
+
private :parse_bind_response
|
164
152
|
|
165
|
-
|
153
|
+
# Definition from RFC 1777 (we're handling application-4 here).
|
154
|
+
#
|
155
|
+
# Search Response ::=
|
156
|
+
# CHOICE {
|
157
|
+
# entry [APPLICATION 4] SEQUENCE {
|
158
|
+
# objectName LDAPDN,
|
159
|
+
# attributes SEQUENCE OF SEQUENCE {
|
160
|
+
# AttributeType,
|
161
|
+
# SET OF AttributeValue
|
162
|
+
# }
|
163
|
+
# },
|
164
|
+
# resultCode [APPLICATION 5] LDAPResult
|
165
|
+
# }
|
166
|
+
#
|
167
|
+
# We concoct a search response that is a hash of the returned attribute
|
168
|
+
# values.
|
169
|
+
#
|
170
|
+
# NOW OBSERVE CAREFULLY: WE ARE DOWNCASING THE RETURNED ATTRIBUTE NAMES.
|
171
|
+
#
|
172
|
+
# This is to make them more predictable for user programs, but it may not
|
173
|
+
# be a good idea. Maybe this should be configurable.
|
174
|
+
def parse_search_return(sequence)
|
175
|
+
sequence.length >= 2 or raise Net::LDAP::PDU::Error, "Invalid Search Response length."
|
176
|
+
@search_entry = Net::LDAP::Entry.new(sequence[0])
|
177
|
+
sequence[1].each { |seq| @search_entry[seq[0]] = seq[1] }
|
178
|
+
end
|
179
|
+
private :parse_search_return
|
166
180
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
# }
|
180
|
-
#
|
181
|
-
# We concoct a search response that is a hash of the returned attribute values.
|
182
|
-
# NOW OBSERVE CAREFULLY: WE ARE DOWNCASING THE RETURNED ATTRIBUTE NAMES.
|
183
|
-
# This is to make them more predictable for user programs, but it
|
184
|
-
# may not be a good idea. Maybe this should be configurable.
|
185
|
-
# ALTERNATE IMPLEMENTATION: In addition to @search_dn and @search_attributes,
|
186
|
-
# we also return @search_entry, which is an LDAP::Entry object.
|
187
|
-
# If that works out well, then we'll remove the first two.
|
188
|
-
#
|
189
|
-
# Provisionally removed obsolete search_attributes and search_dn, 04May06.
|
190
|
-
#
|
191
|
-
def parse_search_return sequence
|
192
|
-
sequence.length >= 2 or raise LdapPduError
|
193
|
-
@search_entry = LDAP::Entry.new( sequence[0] )
|
194
|
-
sequence[1].each {|seq|
|
195
|
-
@search_entry[seq[0]] = seq[1]
|
196
|
-
}
|
197
|
-
end
|
181
|
+
##
|
182
|
+
# A search referral is a sequence of one or more LDAP URIs. Any number of
|
183
|
+
# search-referral replies can be returned by the server, interspersed with
|
184
|
+
# normal replies in any order.
|
185
|
+
#--
|
186
|
+
# Until I can think of a better way to do this, we'll return the referrals
|
187
|
+
# as an array. It'll be up to higher-level handlers to expose something
|
188
|
+
# reasonable to the client.
|
189
|
+
def parse_search_referral(uris)
|
190
|
+
@search_referrals = uris
|
191
|
+
end
|
192
|
+
private :parse_search_referral
|
198
193
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
194
|
+
##
|
195
|
+
# Per RFC 2251, an LDAP "control" is a sequence of tuples, each consisting
|
196
|
+
# of an OID, a boolean criticality flag defaulting FALSE, and an OPTIONAL
|
197
|
+
# Octet String. If only two fields are given, the second one may be either
|
198
|
+
# criticality or data, since criticality has a default value. Someday we
|
199
|
+
# may want to come back here and add support for some of more-widely used
|
200
|
+
# controls. RFC-2696 is a good example.
|
201
|
+
def parse_controls(sequence)
|
202
|
+
@ldap_controls = sequence.map do |control|
|
203
|
+
o = OpenStruct.new
|
204
|
+
o.oid, o.criticality, o.value = control[0], control[1], control[2]
|
205
|
+
if o.criticality and o.criticality.is_a?(String)
|
206
|
+
o.value = o.criticality
|
207
|
+
o.criticality = false
|
208
|
+
end
|
209
|
+
o
|
210
|
+
end
|
211
|
+
end
|
212
|
+
private :parse_controls
|
207
213
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
@ldap_controls = sequence.map do |control|
|
217
|
-
o = OpenStruct.new
|
218
|
-
o.oid,o.criticality,o.value = control[0],control[1],control[2]
|
219
|
-
if o.criticality and o.criticality.is_a?(String)
|
220
|
-
o.value = o.criticality
|
221
|
-
o.criticality = false
|
222
|
-
end
|
223
|
-
o
|
224
|
-
end
|
225
|
-
end
|
214
|
+
# (provisional, must document)
|
215
|
+
def parse_ldap_search_request(sequence)
|
216
|
+
s = OpenStruct.new
|
217
|
+
s.base_object, s.scope, s.deref_aliases, s.size_limit, s.time_limit,
|
218
|
+
s.types_only, s.filter, s.attributes = sequence
|
219
|
+
@search_parameters = s
|
220
|
+
end
|
221
|
+
private :parse_ldap_search_request
|
226
222
|
|
227
|
-
|
223
|
+
# (provisional, must document)
|
224
|
+
def parse_bind_request sequence
|
225
|
+
s = OpenStruct.new
|
226
|
+
s.version, s.name, s.authentication = sequence
|
227
|
+
@bind_parameters = s
|
228
|
+
end
|
229
|
+
private :parse_bind_request
|
228
230
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
s.time_limit,
|
237
|
-
s.types_only,
|
238
|
-
s.filter,
|
239
|
-
s.attributes = sequence
|
240
|
-
@search_parameters = s
|
241
|
-
end
|
231
|
+
# (provisional, must document)
|
232
|
+
# UnbindRequest has no content so this is a no-op.
|
233
|
+
def parse_unbind_request(sequence)
|
234
|
+
nil
|
235
|
+
end
|
236
|
+
private :parse_unbind_request
|
237
|
+
end
|
242
238
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
239
|
+
module Net
|
240
|
+
##
|
241
|
+
# Handle renamed constants Net::LdapPdu (Net::LDAP::PDU) and
|
242
|
+
# Net::LdapPduError (Net::LDAP::PDU::Error).
|
243
|
+
def self.const_missing(name) #:nodoc:
|
244
|
+
case name.to_s
|
245
|
+
when "LdapPdu"
|
246
|
+
warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU instead."
|
247
|
+
Net::LDAP::PDU
|
248
|
+
when "LdapPduError"
|
249
|
+
warn "Net::#{name} has been deprecated. Use Net::LDAP::PDU::Error instead."
|
250
|
+
Net::LDAP::PDU::Error
|
251
|
+
when 'LDAP'
|
252
|
+
else
|
253
|
+
super
|
254
|
+
end
|
255
|
+
end
|
257
256
|
end # module Net
|