]> git.ipfire.org Git - thirdparty/util-linux.git/commit
unshare: Add options to identity map the user's subordinate uids and gids
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 9 Jul 2024 05:44:31 +0000 (15:44 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 9 Jul 2024 07:25:14 +0000 (17:25 +1000)
commitb64b769b40163dd3fc70b933a08babd4d781aba3
tree8015b76d63d6ec2b1554f11b2563c45e2bd19d93
parent41da8d3bb694d543a4e95f4004af35d2d3ec299d
unshare: Add options to identity map the user's subordinate uids and gids

--map-users=auto, --map-groups=auto and --map-auto allow automatically
mapping the first block of user or group IDs owned by the effective user
from /etc/sub[ug]id to a block starting at user ID 0.  Add options
--map-users=subids, --map-groups=subids and --map-subids to perform a
mapping of the same IDs, but as an identity mapping instead of to UID 0.

This is useful in similar situations to --map-current-user, but preserves
access to the user's subordinate IDs.  That allows nested namespaces to
be created with more complex user mappings, either with unshare or with
a container runtime such as podman.

Fixes: https://github.com/util-linux/util-linux/issues/3120
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
sys-utils/unshare.1.adoc
sys-utils/unshare.c