lsns: fix netns use
authorKarel Zak <kzak@redhat.com>
Mon, 22 Apr 2024 12:28:52 +0000 (14:28 +0200)
committerChris Hofstaedtler <zeha@debian.org>
Sat, 27 Apr 2024 12:23:31 +0000 (14:23 +0200)
commitcb815a626a4a7b05994cdb4b86d25124e96b3af1
treeef42c1dfca2b37173a3f1eb52ee906a20d2d0014
parent84415d172a4c4d42654ef1a39e9e3926cf3b22b8
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)

Gbp-Pq: Topic upstream
Gbp-Pq: Name lsns-fix-netns-use.patch
sys-utils/lsns.c