Skip to content

Commit a25e74e

Browse files
author
blackhedd
committed
added the ASN.1 syntax definition for a "present" filter.
1 parent ff01c26 commit a25e74e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

testserver/ldapserver.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ module LdapServer
4242
3 => :array # LDAP SearchRequest
4343
},
4444
:primitive => {
45-
2 => :string # ldapsearch sends this to unbind
45+
2 => :string, # ldapsearch sends this to unbind
4646
}
4747
},
4848
:context_specific => {
4949
:primitive => {
50-
0 => :string # simple auth (password)
50+
0 => :string, # simple auth (password)
51+
7 => :string # present filter
5152
},
5253
}
5354
}
@@ -114,6 +115,8 @@ def handle_search_request pdu
114115
return
115116
end
116117

118+
# pdu[1][7] is the attributes. It's an empty array to signify ALL attributes.
119+
puts "WARNING, not interpreting attributes specifier"
117120
=begin
118121
Search Response ::=
119122
CHOICE {
@@ -187,10 +190,10 @@ def send_ldap_response pkt_tag, msgid, code, dn, text
187190
$logger.info "adding ../lib to loadpath, to pick up dev version of Net::LDAP."
188191
$:.unshift "../lib"
189192

190-
require 'netber'
191-
require 'ldappdu'
192-
require 'netldap'
193-
require 'netldapfilter'
193+
require 'net/ber'
194+
require 'net/ldappdu'
195+
require 'net/ldap'
196+
require 'net/ldapfilter'
194197

195198
EventMachine.run {
196199
$logger.info "starting LDAP server on 127.0.0.1 port 3890"

0 commit comments

Comments
 (0)