GID/UID algorithm? (Re: The story behind UPG and umask.)
Am Wed, 26 May 2010 18:05:32 +0100
schrieb Roger Leigh <firstname.lastname@example.org>:
> How will adduser cope with group addition; does it skip UIDs until
> it finds an unused unique UID/GID pair?
Maybe just skip taken GIDs by default? (every user has one, less gap
more likely to be usable for a user account), starting +1 from the
highest GID that was ever created without specifying specific IDs on
the system (to avoid giving possibly remaining old files from deleted
users/groups to new users/groups). Set that search start pointer back
to MIN_GID if it points to MAX_GID.
If the admin hasn't manually created any users/groups with higer IDs,
the first (+1) GID should already be an available slot.
The UIDs and GIDs match nicely, occasionally (where a regular group
has been created) some UIDs will stay unused. There shouldn' be
Does adduser rely on useradd?