Skip to content

Bind Error is reported as success #231

Closed
@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions