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)
committerCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Thu, 26 Jun 2025 00:44:53 +0000 (21:44 -0300)
commit3c0a7941f0281ca5735c0471010a6b5c208ec53b
treecdd375a36a093df1c900b176ead9356b50865212
parent44368217335892f6c16d5dcd9b77201c05db86c2
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