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.
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().