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>
Sat, 17 Nov 2018 17:39:21 +0000 (17:39 +0000)
commitb89ba630708f7724a1683d6e483bc380a5c8acef
tree60d76f0612f5e08ccf5e2b794663000ce8e676ae
parent9bfd785a0aff4729ac935395505ebccd97c41634
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