machined: when reading os-release file, join PID namespace too
authorLennart Poettering <lennart@poettering.net>
Mon, 12 Nov 2018 22:40:09 +0000 (23:40 +0100)
committerMichael Biebl <biebl@debian.org>
Tue, 20 Nov 2018 18:44:39 +0000 (18:44 +0000)
commitf1f6f6a29c8be013ab0a6cebc58239d6bdf744f8
tree742926eb0ebebede6318f22598dd46402ae64111
parent2452baa369505387f379f5cdffd8a5141f84eccc
machined: when reading os-release file, join PID namespace too

This is required for /proc/self/fd/xyz to work, but that's what we need
to convert the O_PATH fd returned by chase_symlinks() back to a regular
file fd. Hence, let's do the joining of the namespaces fully and
correctly, by doing fork()+setns()+fork() with the PID and fs
namespaces.

This makes use of the new namespace_fork() helper we just added.

Fixes: #10549
(cherry picked from commit 2bb21fc9288100e12f3dc1a0ede1e8487f7f5223)

Gbp-Pq: Name machined-when-reading-os-release-file-join-PID-namespace-.patch
src/machine/machine-dbus.c