]> git.ipfire.org Git - thirdparty/util-linux.git/commit
nsenter: Rewrite --user-parent to use pidfd
authorKarel Zak <kzak@redhat.com>
Mon, 21 Oct 2024 11:09:43 +0000 (13:09 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 21 Oct 2024 12:36:50 +0000 (14:36 +0200)
commit7e60554fc4e8d2dd653b201556aa9e3fd956c968
tree84d94075d77ddaccd29b7412bf6c2dbc4a175732
parent7d2bfa92b463115aafcf0e73b48bf47cdca72f0b
nsenter: Rewrite --user-parent to use pidfd

The latest kernel pidfd supports ioctls to ask for the target's
namespaces. It seems we can use it for --user-parent if no user
namespace is explicitly specified. The fallback is to use any other
namespace or open the target's /proc/<pid>/ns/user file directly.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/nsenter.c