Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74395 - shadow hard-codes outdated nscd socket path
Summary: shadow hard-codes outdated nscd socket path
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-14 09:15 UTC by Phil Pennock
Modified: 2005-01-11 19:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Pennock 2004-12-14 09:15:17 UTC
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 DC 2005-01-11 18:57:49 UTC
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 SpanKY gentoo-dev 2005-01-11 19:21:24 UTC
shadow-4.0.6-r1 fixes the location of the socket, thanks !