]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsns: fix netns use
authorKarel Zak <kzak@redhat.com>
Mon, 22 Apr 2024 12:28:52 +0000 (14:28 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 23 Apr 2024 09:08:50 +0000 (11:08 +0200)
commita8aa0b5f154a44557f5bae5a4027bdbfe42b0323
tree8d0ef34561a69f51a1cbf8556b2c6635a97ea726
parenta8ac243892b0d4b222fe268e740cc500046d0efc
lsns: fix netns use

 # ip netns add vpn
 # lsns -T -t net
 Segmentation fault (core dumped)

The function interpolate_missing_namespaces() reads data from /proc.
However, in the case of a persistent namespace, there is no procfs
entry for the namespace. Therefore, this function should ignore it.

Fixes: https://github.com/util-linux/util-linux/issues/2982
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 42880f54894c1d7fd113552ff8474566a2595a0d)
sys-utils/lsns.c