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)
committerMichael Biebl <biebl@debian.org>
Sun, 7 Aug 2022 13:25:09 +0000 (14:25 +0100)
commitf899ff6cca8fe4346e03fd1da2d24aaf25783460
tree8ba0284baf5f7511165d591cbfa5294a3b77c321
parent62e6118a688b2e4626cc07b256d1122ad5c1dfc1
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.

(cherry picked from commit 98f654fdeab1e1b6df2be76e29e4ccbb6624898d)

Gbp-Pq: Name machine-enter-target-PID-namespace-when-adding-a-live-mou.patch
src/shared/mount-util.c
test/create-busybox-container
test/units/testsuite-13.sh