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)
committerFelipe Sateler <fsateler@debian.org>
Thu, 6 Dec 2018 00:03:34 +0000 (00:03 +0000)
commitf1cbaf3257f2459c2a6e592f89f93e28d529453d
treee8111eb2992e3ccd509ccdd2bd1682d4791f2ed9
parent7a3f72646865c753b81a4805f1fd160b1c86b146
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