Subject: Re: Adding a users group to /etc/group
To: None <abs@netbsd.org>
From: Alistair G. Crooks <agc@ftp.netbsd.org>
List: tech-userlevel
Date: 05/02/2000 04:14:29
> On 29 Apr 2000, Perry E. Metzger wrote:
> 
> > > 	Without a users group the default useradd will fail. Having
> > > 	'useradd bob' fail with 'useradd: group users not found' is
> > > 	pretty lame.
> > 
> > Fine, David. Please discuss this in public for a while and get
> > consensus. Don't go off doing something like this without getting some
> > general sense of what people thing FIRST.
> > 
> > For the moment, could you back it out?
> 
> 	The balance so far seems to be in favour of having the group -
> 	thought I'm willing to back it out pending the conclusion of
> 	the debate if you still think it appropriate?

in basesrc/usr.sbin/user/Makefile, there's a target called
default-group, which is carefully organised to make the default
group for you, should it not exist.

If the default group doesn't exist, it starts at 99 and goes down
by 1, trying to find an unused group. If that is exhausted, it then
goes up from 101, trying to allocate a gid, and stopping at 60000,
when it calls it a day.

The reason for doing this was so that the default group would not
be tied into a numeric value for existing sites, and so that it
could be dynamically allocated, and just work.

I'm not too happy with having a value in /etc/group, but can see
that it's necessary for new hosts. However, I also believe that
functionality is provided by the "default-target" in
basesrc/usr.sbin/user/Makefile.

Why bother re-inventing wheels?

Alistair