]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: Support idmapped mounts on homed managed home directories 38069/head
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Fri, 4 Jul 2025 18:19:26 +0000 (20:19 +0200)
committerDaanDeMeyer <daan.j.demeyer@gmail.com>
Mon, 7 Jul 2025 11:58:52 +0000 (13:58 +0200)
commit90fa161b5ba29d58953e9f08ddca49121b51efe6
tree756ab00d07208964f8cb40cd5d7e406ee90170d4
parentbda934d4e52794060deb204ee74fb62ab924e98f
nspawn: Support idmapped mounts on homed managed home directories

Christian made this possible in Linux 6.15 with a new system call
open_tree_attr() that combines open_tree() and mount_setattr().
Because idmapped mounts are (rightfully) not nested, we have to do
some extra shenanigans to make source we're putting the right source
uid in the userns for any idmapped mounts that we do in nspawn.

Of course we also add the necessary boilerplate to make open_tree_attr()
available in our code and wrap open_tree_attr() and the corresponding
fallback in a new function which we then use everywhere else.
src/nspawn/nspawn-mount.c
src/shared/mount-util.c
src/shared/mount-util.h