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

Set operation result if LDAP server is not accessible #232

Merged
merged 1 commit into from Nov 6, 2015
Merged

Set operation result if LDAP server is not accessible #232

merged 1 commit into from Nov 6, 2015

Conversation

ghost
Copy link

@ghost ghost commented Nov 5, 2015

This should fix #231.


ldap_client = Net::LDAP.new(host: '127.0.0.1', port: 12345)

assert_raise Net::LDAP::ConnectionRefusedError do
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not not a reqular user of minitest. If there's a better approach to handle errors, I'm open to fix this. begin; rescue; end didn't work for that use case.

@ghost
Copy link
Author

ghost commented Nov 5, 2015

@padde Again FYI

@jch
Copy link
Member

jch commented Nov 6, 2015

Thanks for this PR. I've been rescuing the errors and assuming the result code is invalid, but this avoids surprising and unexpected behavior. From RFC 4511:

      unavailable (52)
         Indicates that the server is shutting down or a subsystem
         necessary to complete the operation is offline.

Seems like a good fit.

jch added a commit that referenced this pull request Nov 6, 2015
…t_connection_refused

Set operation result if LDAP server is not accessible
@jch jch merged commit c89d493 into ruby-ldap:master Nov 6, 2015
@ghost
Copy link
Author

ghost commented Nov 9, 2015

Cool. Thanks a lot! Can you a release 0.12.1 with this fix? This would help me getting a system live. :-)

@jch jch mentioned this pull request Nov 11, 2015
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Dec 12, 2015
=== Net::LDAP 0.12.1

* Whitespace formatting cleanup
  {#236}[ruby-ldap/ruby-net-ldap#236]
* Set operation result if LDAP server is not accessible
  {#232}[ruby-ldap/ruby-net-ldap#232]

=== Net::LDAP 0.12.0

* DRY up connection handling logic
  {#224}[ruby-ldap/ruby-net-ldap#224]
* Define auth adapters
  {#226}[ruby-ldap/ruby-net-ldap#226]
* add slash to attribute value filter
  {#225}[ruby-ldap/ruby-net-ldap#225]
* Add the ability to provide a list of hosts for a connection
  {#223}[ruby-ldap/ruby-net-ldap#223]
* Specify the port of LDAP server by giving INTEGRATION_PORT
  {#221}[ruby-ldap/ruby-net-ldap#221]
* Correctly set BerIdentifiedString values to UTF-8
  {#212}[ruby-ldap/ruby-net-ldap#212]
* Raise Net::LDAP::ConnectionRefusedError when new connection is
  refused. {#213}[ruby-ldap/ruby-net-ldap#213]
* obscure auth password upon #inspect, added test, closes #216
  {#217}[ruby-ldap/ruby-net-ldap#217]
* Fixing incorrect error class name
  {#207}[ruby-ldap/ruby-net-ldap#207]
* Travis update {#205}[ruby-ldap/ruby-net-ldap#205]
* Remove obsolete rbx-19mode from Travis
  {#204}[ruby-ldap/ruby-net-ldap#204]
* mv "sudo" from script/install-openldap to .travis.yml
  {#199}[ruby-ldap/ruby-net-ldap#199]
* Remove meaningless shebang
  {#200}[ruby-ldap/ruby-net-ldap#200]
* Fix Travis CI build
  {#202}[ruby-ldap/ruby-net-ldap#202]
* README.rdoc: fix travis link
  {#195}[ruby-ldap/ruby-net-ldap#195]
astratto pushed a commit to astratto/ruby-net-ldap that referenced this pull request Dec 18, 2015
…ion_result_connection_refused

Set operation result if LDAP server is not accessible
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 this pull request may close these issues.

Bind Error is reported as success
1 participant