Bug 3643 - ncsd changes semantics of multiple users with same uid
ncsd changes semantics of multiple users with same uid
Product: Red Hat Linux
Classification: Retired
Component: yp-tools (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
Depends On:
  Show dependency treegraph
Reported: 1999-06-22 15:51 EDT by Jay Berkenbilt
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-07-02 18:35:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jay Berkenbilt 1999-06-22 15:51:18 EDT
(Note: nscd is not available as a component when entering a
bug, so, since component is mandatory, I've chosen yp-tools
even though this doesn't have anything to do with that.)

When multiple users with the same uid appear in the passwd
file, mapping from uid to username always matches the first
entry.  This allows one to create multiple logins for the
same uid -- a very useful feature, and one that has existed
in UNIX environments for as long as I can recall.

When using nscd, the semantics change -- the uid to username
mapping resolves to whichever user was last accessed.

For example, create a user called "dump" in the passwd file
with uid 0.  Make sure dump comes after root.  Do ps aux.
Most processes are owned by root.  Now do su dump -fc
whoami.  Now do ps aux again.  Most processes are owned by
dump.  whoami returns dump.  If you stop nscd, this problem
goes away.

This can be a serious problem.  A lot of programs don't work
right if uid 0 doesn't map to root, but some software or
configurations may require a particular username to be
configured for a particular service.  Other similar problems
can occur with, for example, multiple logins to the same
guest ftp account.

Even though I think this is a fairly serious problem, I've
suggested "normal" for both priority and severity since the
workaround of not running nscd is simple and effective...
Comment 1 Cristian Gafton 1999-07-02 18:35:59 EDT
"Don't do that then". Having duplicate UIDs, you're on your own.
Especially for root.

Note You need to log in before you can comment on or make changes to this bug.