[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/passwd doesnt contain all users



On Mon, Dec 23, 2002 at 06:16:20PM +0000, Colin Watson wrote:

> On Mon, Dec 23, 2002 at 11:02:38AM -0500, Matt Zimmerman wrote:
> > On Mon, Dec 23, 2002 at 01:36:19AM -0600, Matt Hope wrote:
> > > A few packages that I've run across check /etc/passwd to see if a user
> > > exists, and if not, creates them.
> > > 
> > > This can be a problem in systems that use alternate authentication
> > > schemes, such as NIS, or LDAP.
> > > 
> > > Could any developers who do this please look at using an alternate
> > > test, such as using /usr/bin/id, or /usr/bin/getent ?
> > 
> > File bugs against these packages telling them to use getent.
> 
> I think base-passwd is an exception here - ids < 100 should be in the
> local /etc/passwd, especially since there's no way for base-passwd to
> sensibly change their fields when necessary otherwise. In other cases
> (system users and groups), sure, getent is the way to go.

Yes, that makes sense.  Though now that I think about it, there is really
very little reason to check for the existence of a user at all.  Most
packages should be using adduser, which will do the right thing if the user
already exists.

-- 
 - mdz



Reply to: