]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: Communicate determined UID shift to parent 492/head
authorRichard Maw <richard.maw@codethink.co.uk>
Tue, 30 Jun 2015 13:41:41 +0000 (13:41 +0000)
committerRichard Maw <richard.maw@codethink.co.uk>
Mon, 6 Jul 2015 12:23:19 +0000 (13:23 +0100)
commit825d5287d7717b2dd220846217891c110e7c3083
tree04d538c0172c5b0cc4c7b1a54b5580754c4e4885
parent6482446281b226a9a74cb17bfc28e98554cbc437
nspawn: Communicate determined UID shift to parent

There is logic to determine the UID shift from the file-system, rather
than having it be explicitly passed in.

However, this needs to happen in the child process that sets up the
mounts, as what's important is the UID of the mounted root, rather than
the mount-point.

Setting up the UID map needs to happen in the parent becuase the inner
child needs to have been started, and the outer child is no longer able
to access the uid_map file, since it lost access to it when setting up
the mounts for the inner child.

So we need to communicate the uid shift back out, along with the PID of
the inner child process.

Failing to communicate this means that the invalid UID shift, which is
the value used to specify "this needs to be determined from the file
system" is left invalid, so setting up the user namespace's UID shift
fails.
src/nspawn/nspawn.c