[Pkg-shadow-devel] The way UIDs and GIDs are created

Serge E. Hallyn serge at hallyn.com
Fri Sep 23 14:00:07 UTC 2016

On Mon, Sep 19, 2016 at 11:08:54PM +0200, Martin Bammer wrote:
> Hi,
> I've got a suggestion for an alternative UID and GID generation algorithm.
> Currently UIDs and GIDs are generated in a way so that the next free one is
> chosen when a new user or group is generated.
> This leads to problems in small networks with unmanaged users which is the
> normal case in home networks.
> For users it is very confusing when they share files via Linux/Unix file
> systems and these files seem to be owned by different users depending on
> the machine where the files are listed.
> Wouldn't it be a good idea to have an option to generate UIDs and GIDs by
> calculating a hash value?
> I know this method is not 100% perfect because at least on Linux currently
> only 32bit (or on some systems 31bit) are used for this metadata and there

Also there's now the concept of subuids and subgids which can leave a quite
small set of usable uids and which, moreover, would become unusable after
the first few random uids, as the subuids need to (each) be a consecutive range.

> is a chance to have collisions. But for small home networks with unmanaged
> users this method would work most of the time and if there is a collision
> the user can be informed about it that an alternative value was chosen.
> This method would bring the advantage that users and groups with the same
> names usually have the same UIDs/GIDs across all the machines independent
> of the order the users were created.
> NFS ID-mapping would also usually be not needed.
> So what do you think?


More information about the Pkg-shadow-devel mailing list