]> git.ipfire.org Git - thirdparty/util-linux.git/commit
unshare: Support multiple ID ranges for user and group maps
authorChris Webb <chris@arachsys.com>
Thu, 23 Nov 2023 12:24:58 +0000 (12:24 +0000)
committerChris Webb <chris@arachsys.com>
Wed, 29 Nov 2023 21:19:22 +0000 (21:19 +0000)
commita212f1fc8319efa19e55686f31deb65372343a01
tree5dc9f9e86d3769f4f7c2e67c7b9192b6764bde7e
parent6a82643ad3ff237181b7e0fca1640282430625ca
unshare: Support multiple ID ranges for user and group maps

Accept multiple --map-users and --map-groups options to specify disjoint ID
ranges to map inside a user namespace. This was already supported by mount
--map-groups and --map-users, but paradoxically not by unshare itself.

Factor out the hole-punching logic which removes single-ID mappings set
with --map-user and --map-group from range mappings set with --map-users
and --map-groups. add_single_map_range() now performs this fixup for
every given range before prepending the single-ID mapping.

Signed-off-by: Chris Webb <chris@arachsys.com>
sys-utils/unshare.1.adoc
sys-utils/unshare.c