Bug 34787 - libnss-ldap connection problems
libnss-ldap connection problems
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
:
Depends on: 33292
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-09 06:56 CEST by Stefan Gohmann
Modified: 2020-07-03 20:53 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.046
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-05-09 06:56:19 CEST
libnss-ldap.conf is not readable by normal users. But nss-ldap could be triggered by normal users. It this case the config option nssldap/nss_srv is not readable by the user.

We should change the code that the srv record usage must be explicit enabled.


+++ This bug was initially created as a clone of Bug #33292 +++

Seen at ticket #2013011421000766:

Sometimes the customer sees error messages in the auth.log at memberservers:
"
nss_ldap: could not connect to any LDAP server as (null) - Can't contact LDAP server Nov 
6 16:17:40 servername ls: nss_ldap: failed to bind to LDAP server ldap://servername:389:
Can't contact LDAP server
"

This is repeated for every ldap server registered in ldap-srv record.
The only case in which this record is used is located at "ldap-nss.c" if the ldap config could not be parsed - we've tested that and there is no obvious explanation for that. The config is readable and okay.

With strace and wireshark I saw that the connections are only hitting one server - the first in the ldap config. I also saw that this system uses an ip adress from an external range (duplicated) - perhaps thats the point if sometimes the name resolution is done externally?
In wireshark you can see a tcp rst when this phenomenon starts. Afterwards even if auth.log sais that connection against all other ldap servers fails I cannot see connection tries in wireshark...perhaps wrong debugging.

After all systems from the srv record are "tried" everything works again like expected.

strace, logs and tcpdump can be obtained from otrs - not attaching them here due to customer related information.
Comment 1 Stefan Gohmann univentionstaff 2017-06-16 20:37:23 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 2 Florian Best univentionstaff 2017-06-28 14:52:07 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 3 Jürn Brodersen univentionstaff 2017-07-06 11:34:02 CEST
Still a problem in 4.2, but as long as nscd runs everything is fine.

apache basic auth (used by nagios) breaks for example if nscd is stopped.

Because nscd is only a cache, I would expect everything working the same if it is stopped.
Since nscd is probably running on most installation, I set the "Who is affected" flag to 1.
Comment 4 Philipp Hahn univentionstaff 2017-07-18 10:32:26 CEST
(In reply to Jürn Brodersen from comment #3)
> Still a problem in 4.2, but as long as nscd runs everything is fine.
> 
> apache basic auth (used by nagios) breaks for example if nscd is stopped.
> 
> Because nscd is only a cache, I would expect everything working the same if
> it is stopped.

FYI:
Things work when `nscd` runs as it rungs as user 'root', has permissions to read '/etc/libnss-ldap.secret' and can thus query the LDAP server, which required authentication.

When `nscd` does *not* run, any process not run by 'root' will fail to get the same information from LDAP.
Comment 5 Ingo Steuwer univentionstaff 2020-07-03 20:53:56 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.