]> git.ipfire.org Git - thirdparty/systemd.git/commit
namespace-util: introduce userns_acquire_self_root()
authorLennart Poettering <lennart@poettering.net>
Mon, 10 Mar 2025 10:30:11 +0000 (11:30 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Mar 2025 15:03:18 +0000 (16:03 +0100)
commit783b40bd73aafa5993a64f7a795f2f91def3c487
treeaf6039afaa594b4c0718bee38fec4fc3bbd57f13
parent6431c34b8a8487fb50c9cb850bd7d3bf81ad9e2a
namespace-util: introduce userns_acquire_self_root()

This is a simple helper for creating a userns that just maps the
callers user to UID 0 in the namespace. This can be acquired unpriv,
which makes it useful for various purposes, for example for the logic in
is_idmapping_supported(), hence port it over.

(is_idmapping_supported() used a different mapping before, with the
nobody users, but there's no real reason for that, and we'll use
userns_acquire_self_root() elsewhere soon, where the root mapping is
important).
src/basic/namespace-util.c
src/basic/namespace-util.h