Bug 74395 - shadow hard-codes outdated nscd socket path
Bug#: 74395 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: major Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: gentoo@spodhuis.org
Component: Core system
URL: 
Summary: shadow hard-codes outdated nscd socket path
Keywords:  
Status Whiteboard: 
Opened: 2004-12-14 09:15 0000
Description:   Opened: 2004-12-14 09:15 0000
With nscd running, a user added by useradd(8) can't immediately be deleted by
userdel(8).  These tools attempt to notify the nscd using the socket, but the
path to the socket has been changed and the shadow tools still use the old
path.

Reproducible: Always
Steps to Reproduce:
1. /etc/init.d/nscd start
2. useradd fred
3. userdel fred

Actual Results:  
(standard prompt modified to include $?:)

0: domus root # id fred
id: fred: No such user
1: domus root # useradd fred
0: domus root # userdel fred
userdel: user fred does not exist
6: domus root # id fred
uid=1101(fred) gid=100(users) groups=100(users)


Expected Results:  
Deleted user.

Shutting down nscd allows the user to be deleted.
strace(1) shows that usermod is attempting to talk to nscd via:
 /var/run/.nscd_socket
whereas this should now be:
 /var/run/nscd/socket

Inside the sys-apps/shadow source, lib/nscd.c contains a definition of
_PATH_NSCDSOCKET which can be changed to the correct path to get a working set
of tools.

------- Comment #1 From DC 2005-01-11 18:57:49 0000 -------
I have a related bug to report: because nscd now expects its pidfile to be in
/var/run/nscd/, if that directory doesn't exist, nscd won't start (but since
the /etc/init.d/nscd script doesn't handle this case, it just fails silently,
and you don't notice anything is wrong).

Recommended fix for this: create the directory if it doesn't already exist, and
correct the --pid argument in stop().

------- Comment #2 From SpanKY 2005-01-11 19:21:24 0000 -------
shadow-4.0.6-r1 fixes the location of the socket, thanks !