]> git.ipfire.org Git - thirdparty/systemd.git/commit
machine: enter target PID namespace when adding a live mount
authorLuca Boccassi <bluca@debian.org>
Wed, 13 Jan 2021 23:52:00 +0000 (23:52 +0000)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Mon, 18 Jan 2021 17:24:05 +0000 (17:24 +0000)
commit98f654fdeab1e1b6df2be76e29e4ccbb6624898d
tree8be7b21c4c2c8a78a808c511802383fefbca86b1
parent2338a175fdec3859eab03115ca82a0d58453f5d7
machine: enter target PID namespace when adding a live mount

machinectl fails since 21935150a0c42b91a322105f6a9129116bfc8e2e as it's now
mounting onto a file descriptor in a target namespace, without joining the
target's PID namespace.
Note that it's not enough to setns CLONE_NEWPID, but a double-fork is required
as well, as implemented by namespace_fork().

Add a test case to TEST-13-NSPAWN to cover this use case.
src/shared/mount-util.c
test/create-busybox-container
test/units/testsuite-13.sh