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

Re: UID and GID generation



Martin Bammer wrote...

> I've got an issue with the generation of UIDs and GIDs when new
> users are added. By default UIDs and GIDs for users and user groups
> are values starting from 1000 (on Red Hat from 500). When a user is
> added the next free value is chosen.

Yes, also NFS has a problem here unless you use some additional ID
mapping.

Similar, system user IDs: If you want to migrate to a new installation
but there are a lot of files that should be preserved, think
/var/lib/munin/.

For all such situations a workaround exists. Still I've been wondering
for years why appearently nobody else considers this a problem. So I
patched adduser to determine the user (also: group) ID from a static
"acount name"<->"ID" mapping. It's in the BTS somewhere eight years
ago, and I use an updated version still today. Migration of existing
installations was painful but worth it, YMMV.

> So my suggestion would be to change the default behavior of UID and
> GID generation to hash value calculation. Has values are computed by
> the user and group names as 32bit values on Debian (31bit on Red
> Hat). The minimum and maximum values should be configurable.

Given Murphy and birthday paradoxon, this will bite you much sooner
than you'd expect.

> IMHO the current implementation is a design bug which must be fixed.

I wouldn't use the b word here. The implementation is simple but
introduces problems once you have more than one machine.

    Christoph

Attachment: signature.asc
Description: Digital signature


Reply to: