File tree Expand file tree Collapse file tree 1 file changed +22
-21
lines changed Expand file tree Collapse file tree 1 file changed +22
-21
lines changed Original file line number Diff line number Diff line change 1414
1515#------------------------------------------------
1616
17- module LdapServer
18- LdapServerAsnSyntax = {
19- :application => {
20- :constructed => {
21- 0 => :array , # LDAP BindRequest
22- 3 => :array # LDAP SearchRequest
23- } ,
24- :primitive => {
25- 2 => :string , # ldapsearch sends this to unbind
26- } ,
27- } ,
28- :context_specific => {
29- :primitive => {
30- 0 => :string , # simple auth (password)
31- 7 => :string # present filter
32- } ,
33- :constructed => {
34- 3 => :array # equality filter
35- } ,
36- } ,
37- }
17+ module LdapServer
3818
3919 def post_init
4020 $logger. info "Accepted LDAP connection"
@@ -192,6 +172,27 @@ def load_test_data
192172
193173 require 'net/ldap'
194174
175+ LdapServerAsnSyntax = Net ::BER . compile_syntax ( {
176+ :application => {
177+ :constructed => {
178+ 0 => :array , # LDAP BindRequest
179+ 3 => :array # LDAP SearchRequest
180+ } ,
181+ :primitive => {
182+ 2 => :string , # ldapsearch sends this to unbind
183+ } ,
184+ } ,
185+ :context_specific => {
186+ :primitive => {
187+ 0 => :string , # simple auth (password)
188+ 7 => :string # present filter
189+ } ,
190+ :constructed => {
191+ 3 => :array # equality filter
192+ } ,
193+ } ,
194+ } )
195+
195196 EventMachine . run do
196197 $logger. info "starting LDAP server on 127.0.0.1 port 3890"
197198 EventMachine . start_server "127.0.0.1" , 3890 , LdapServer
You can’t perform that action at this time.
0 commit comments