]> git.ipfire.org Git - thirdparty/util-linux.git/commit
nsenter: Support specifying namespace by ID
authorXiao Liang <shaw.leon@gmail.com>
Sat, 14 Feb 2026 03:23:42 +0000 (11:23 +0800)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Feb 2026 11:43:38 +0000 (12:43 +0100)
commitf2a5997869d8edcf2801a82aa2075f3f7498b73a
treea6576e1b1a838088be9dab9898a19e6d886275cb
parentae8bbd3630ab9f111b9f0f09a6dd8407f8745e94
nsenter: Support specifying namespace by ID

Linux kernel v6.19 introduces listns() syscall that lists namespace IDs,
as well as the support for opening an nsfile by a file_handle of ns ID.

This patch allows specifying namespaces by ID for nsenter. For example:

  # nsenter --net=:7

enters init net namespace (7 for NET_NS_INIT_ID).

In the rare case that a ns file name starts with a colon, prepend "./"
for disambiguation.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
configure.ac
meson.build
sys-utils/nsenter.1.adoc
sys-utils/nsenter.c