]> git.ipfire.org Git - thirdparty/util-linux.git/commit
unshare: Fix "you (user xxxx) don't exist" error when uid differs from primary gid
authorSol Boucher <sboucher@cmu.edu>
Fri, 8 Jul 2022 16:09:13 +0000 (12:09 -0400)
committerSol Boucher <sboucher@cmu.edu>
Fri, 8 Jul 2022 16:14:29 +0000 (12:14 -0400)
commitc6fa0ebd7b0b6d2da5dd4d3edd5e885632ff65d0
treefc09d44127614978d0fb7cdeade95907c158ee8e
parentaff94adda7d94f79d184db1a524c5a79119c8a28
unshare: Fix "you (user xxxx) don't exist" error when uid differs from primary gid

This problem affected the --map-auto and --map-groups=auto command-line switches.
The root cause is that /etc/subgid is indexed by user or uid, not by group or gid;
therefore, we should be using the effective uid to find entries in this file, just
as we do for /etc/subuid.

Signed-off-by: Sol Boucher <sboucher@cmu.edu>
sys-utils/unshare.c