]>
git.ipfire.org Git - thirdparty/util-linux.git/commit
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>