Bug 1448512 - ldapsearch: Misleading error when hostname is not resolvable
Summary: ldapsearch: Misleading error when hostname is not resolvable
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: openldap
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Simon Pichugin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-05 15:45 UTC by Martin Bašti
Modified: 2020-11-26 20:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-26 20:38:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Bašti 2017-05-05 15:45:36 UTC
Instead of "Unable to resolve hostname" I received "Can't contact LDAP server (-1)" when a bad hostname has been used. This error is confusing for users.

Additional info from Matus Honek:

I tested with ldapsearch like here:
```
$ ldapsearch -H ldap://blah.blah.blah -d -1
ldap_url_parse_ext(ldap://blah.blah.blah)
ldap_create
ldap_url_parse_ext(ldap://blah.blah.blah:389/??base)
ldap_sasl_interactive_bind: user selected: GSSAPI
ldap_int_sasl_bind: GSSAPI
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP blah.blah.blah:389
ldap_connect_to_host: getaddrinfo failed: Name or service not known
ldap_msgfree
ldap_err2string
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)
```
There we got the getaddrinfo failing with a helpful info. In libldap,
however, when getaddrinfo fails, only a return code gets propagated down
to ldap_sasl_interactive_bind_s with no helpful message set.
 
Looks like libldap could set the LDAP_OPT_DIAGNOSTIC_MESSAGE (which
ipa-getkeytab does printf when an error happens then) when getaddrinfo
fails and then it should get propagated down to the point where you
print it. It would be quite a clean solution. Only if... Technically,
the LDAP_OPT_DIAGNOSTIC_MESSAGE seems to be set nowhere in OpenLDAP's
source code; I asked the upstream, we'll see if there's an answer to
that. Moreover, this is just a string and if you would like to do some
further processing based on the exact error (like here, EAI_* error
codes from getaddrinfo) then a human readable string is not much
feasible.

Comment 1 Fedora End Of Life 2017-11-16 19:36:13 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Fedora Admin user for bugzilla script actions 2020-09-11 14:53:39 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 3 Simon Pichugin 2020-11-26 20:38:04 UTC
OpenLDAP on Fedora is on maintenance mode and we mostly just rebuild versions and following Upstream.

If you want to make any changes to OpenLDAP package, please, file a bug to https://bugs.openldap.org/


Note You need to log in before you can comment on or make changes to this bug.