First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 156511
Alias:
Product:
Component:
Status: RESOLVED
Resolution: INVALID
Assigned To: LDAP Herd <ldap-bugs@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Kevin Bryan <TenToThe8th@yahoo.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 156511 depends on: Show dependency tree
Bug 156511 blocks: 147625
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-11-28 07:00 0000
# cat /etc/nsswitch.conf 
...
passwd:      files nis ldap
...

# getent passwd username
username:x:10000:600:User Name:/home/username:/bin/bash

# getent -s ldap passwd username -> hangs

Running strace against it shows that it gets stuck on a futex.  This is the
same with nss_ldap-239-r1 and nss_ldap-253. glibc-2.4-r4 with "nls nptl
nptlonly".  getent with '-s file' or '-s nis' work fine.

------- Comment #1 From Robin Johnson 2006-11-28 13:38:29 0000 -------
1. and plain 'getent password username' ?
2. what is your ssl configuration in /etc/ldap.conf?

------- Comment #2 From Kevin Bryan 2006-11-29 04:32:50 0000 -------
(In reply to comment #1)
> 1. and plain 'getent password username' ?
> 2. what is your ssl configuration in /etc/ldap.conf?
> 

1. As shown in the original report, 'getent passwd username' works fine.
2. /etc/ldap.conf has 'ssl no'.

------- Comment #3 From Robin Johnson 2006-11-29 12:47:11 0000 -------
base-system/vapier: did something change in glibc's nss stuff again?
getent -s ldap worked previously...

Kevin Bryan:
1. please provide the contents of your /etc/ldap.conf here, exluding the
comments in it. 
2. if your uri/host lines uses a hostname, try with it in /etc/hosts, or try
with an IP directly.

------- Comment #4 From Kevin Bryan 2006-12-01 05:54:15 0000 -------
ldap.conf:
host ldap1.domain.tld ldap2.domain.tld
base dc=domain,dc=tld
rootbinddn cn=nssldap,ou=DSA,dc=domain,dc=tld
timelimit 30
bind_timelimit 30
bind_policy hard
idle_timelimit 3600
nss_base_passwd     dc=domain,dc=tld?sub
nss_base_shadow     dc=domain,dc=tld?sub
nss_base_group            ou=Groups,dc=domain,dc=tld?one
ssl no
sizelimit 0
pam_password md5

Adding ldap1.domain.tld and ldap3.domain.tld to /etc/hosts did not
change the behavior, nor did replacing it with an IP.  In both cases, strace
shows it hanging on the futex.

------- Comment #5 From SpanKY 2006-12-02 15:48:29 0000 -------
no idea, i dont track nss stuff as i dont use it at all

------- Comment #6 From simishag 2006-12-14 11:12:43 0000 -------
I'm not sure which bug is the best to note this on, but I've added a post at
robbat's blog that may help:

http://robbat2.livejournal.com/199841.html

Basically it concerns the problems with nss_ldap 249 and timeout weirdness.

------- Comment #7 From Robin Johnson 2006-12-15 19:48:08 0000 -------
Upstream bug:
http://bugzilla.padl.com/show_bug.cgi?id=176

This is also responsible for Gentoo bug 147625.

While the upstream bug has not seen much response from Luke Howard, here is my
theory about the futex.

If you do 'getent -s $SRC $TYPE', then /etc/nsswitch.conf is overridden, and
$SRC is used instead. If you use a hostname for your LDAP server, this would
mean that a circular loop exists, just as if you did 'getent -s ldap hosts',
because regardless of what source you use, nss_ldap (via the ldap libraries)
would be doing a hostname lookup to connect to the LDAP server.

Test these two nsswitch.conf configurations:
1.
passwd: files ldap
host: files dns
2.
passwd: files ldap
host: files dns ldap 
3.
passwd: files ldap
host: ldap files dns

#1 and #2 should work.
#3 should hang with the same futex.

simishag:
Your comment was incorrectly placed here. I responded to it on my blog.

------- Comment #8 From Kevin Bryan 2006-12-16 17:19:27 0000 -------
1 corresponds to my setup, yet it still does not work.  I tested it on several
other machines that I have.  Here's the results:

nss_ldap-239-r1 works with both pam_ldap 180 and 183.
neither nss_ldap-249 nor nss_ldap-253 work with pam_ldap 183.

------- Comment #9 From Robin Johnson 2006-12-16 18:02:09 0000 -------
I meant for you to test all 3 nsswitch.conf configurations that I posted.
Command to test is 'getent passwd' (notice NO -s ldap on purpose).

------- Comment #10 From Kevin Bryan 2006-12-16 20:07:57 0000 -------
Yes, it acts as you suspect.  1 and 2 work fine, and 3 stops on a futex.

------- Comment #11 From Robin Johnson 2006-12-17 03:19:06 0000 -------
vapier:
ok, this proves there is a specific breakage in the genent application.

State BEFORE:
"getent -s $SRC $FOO" overrides nsswitch.conf for $FOO only, so that it would
be the same as '$FOO: $SRC', but the other lines would be untouched.

State AFTER:
"getent -s $SRC $FOO" overrides ALL entries in nsswitch.conf, which is a
problem as 'host: ldap' then has a circular loop in lookup (to connect to the
LDAP server it needs to do the lookup, but for the lookup it needs to connect
to LDAP). Specifically, gethostbyname() triggers the NSS lookup.

This is NOT a recent breakage in glibc, so it's going to be hard to find.
If you look at the upstream bug report, it was originally in debian's
glibc-2.3.2.ds1-13.

------- Comment #12 From Kevin Bryan 2007-09-26 19:45:33 0000 -------
(In reply to comment #11)
> vapier:
> ok, this proves there is a specific breakage in the genent application.
> 
> State BEFORE:
> "getent -s $SRC $FOO" overrides nsswitch.conf for $FOO only, so that it would
> be the same as '$FOO: $SRC', but the other lines would be untouched.
> 
> State AFTER:
> "getent -s $SRC $FOO" overrides ALL entries in nsswitch.conf, which is a
> problem as 'host: ldap' then has a circular loop in lookup (to connect to the
> LDAP server it needs to do the lookup, but for the lookup it needs to connect
> to LDAP). Specifically, gethostbyname() triggers the NSS lookup.

Apparently it's not breakage, it's an "undocumented feature."  No, seriously:

getent -s passwd:ldap passwd username

works fine.  If you just do:

getent -s ldap passwd username

then the -s takes affect for all databases.  Note that the getent --help (there
is no man page) doesn't explain this.  Had to pull open getent.c and read the
parse_option code (in glibc-2.5, anyways, probably the same in all "affected"
versions).

First Last Prev Next    No search results available      Search page      Enter new bug