]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsns: make "-Q NETNSID ..." work even if NETNSID column is not enabled
authorMasatake YAMATO <yamato@redhat.com>
Fri, 7 Mar 2025 21:42:18 +0000 (06:42 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Fri, 7 Mar 2025 23:03:24 +0000 (08:03 +0900)
commite04238952520d485d69a0ad4d30bb7ab9a6fd075
treeac48e3c6d7eb6bf2ac152e954812d9acb3dafc6a
parentfdf3008b692271889248f8b077f3a5a7cad77661
lsns: make "-Q NETNSID ..." work even if NETNSID column is not enabled

With the original code, lsns didn't collect values for NETNSID
unless NETNSID column was enabled. As a result, a filter expression
referencing NETNSID value didn't work expectedly.

  # ip netns add X
  # ip netns set X 99999
  # lsns-original -Q 'NETNSID == "99999"
(PRINT NOTHING)
  # lsns-original -Q 'NETNSID == "99999" -o NETNSID
  NETNSID
    99999

With this change, lsns collects values for NETNSID if the
filter expression given to -Q option refers to NETNSID.

  # lsns-new -Q 'NETNSID == "99999"
            NS TYPE NPROCS PID USER COMMAND
    4026535564 net       0     root

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
sys-utils/lsns.c