Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind Error is reported as success #231

Closed
ghost opened this issue Nov 5, 2015 · 1 comment · Fixed by #232
Closed

Bind Error is reported as success #231

ghost opened this issue Nov 5, 2015 · 1 comment · Fixed by #232

Comments

@ghost
Copy link

ghost commented Nov 5, 2015

I used version 0.12.0. No LDAP-server running! So the bind fails.

Given that script:

#!/usr/bin/env ruby

require 'net/ldap'

ldap_client = Net::LDAP.new(host: '127.0.0.1', port: '12345', base: 'dc=example,dc=org')
begin
  ldap_client.bind(method: :simple, username: 'asdf', password: 'asdf')
rescue => e
  $stderr.puts e.class
  $stderr.puts e.message
  $stderr.puts ldap_client.get_operation_result
  $stderr.puts ldap_client.get_operation_result.message
end

When you save it as my-client.rb and run it, it outputs success. Not what I expected.

ruby my-script
# => Deprecation warning: Net::LDAP::ConnectionRefused will be deprecated. Use Errno::ECONNREFUSED instead.
# => Net::LDAP::ConnectionRefusedError
# => Deprecation warning: Net::LDAP::ConnectionRefused will be deprecated. Use Errno::ECONNREFUSED instead.
# => Connection refused - connect(2) for "127.0.0.1" port 12345
# => #<OpenStruct code=0, message="Success">
# => Success

I would have expected it to return ResultCodeUnavailable = 52.

@ghost
Copy link
Author

ghost commented Nov 5, 2015

@padde FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants