]> git.ipfire.org Git - thirdparty/util-linux.git/commit
unshare: Fix PID and TIME namespace persistence
authormichael-dev <michael-dev@fami-braun.de>
Wed, 15 Apr 2020 21:16:53 +0000 (23:16 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 30 Apr 2020 08:59:38 +0000 (10:59 +0200)
commit0d5260b66c5581c8a5855a5f49e298e48e8baf82
tree482a7313b758e6d266a5a1176d93632db04d09a5
parent76f969fe6ff149c7748894dcf881218f84873d67
unshare: Fix PID and TIME namespace persistence

After unshare(...) is called, /proc/self/ns/pid does not change.
Instead, only /proc/self/ns/pid_for_children is affected. So bind-mounting
/proc/self/ns/pid results in the original namespace getting bind-mounted.

Fix this by instead bind-mounting ns/pid_for_children.

[kzak@redhat.com: - add ns/time_for_children
                  - remove C++ comments
                  - resolve commit conflicts]

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/unshare.1
sys-utils/unshare.c