~apparmor-dev/apparmor/2.11

Viewing all changes in revision 3608.

  • Committer: Steve Beattie
  • Date: 2016-12-30 20:15:16 UTC
  • Revision ID: sbeattie@ubuntu.com-20161230201516-lf17fosmlovu5gz3
utils/aa-unconfined: fix netstat usage, use ss(8) by default

It was reported that converting the netstat command to examine
processes bound to ipv6 addresses broke on OpenSUSE due to the version
of nettools not supporting the short -4 -6 arguments.

This patch switches to use the ss(8) utility from iproute2 by default
(if ss is found) as netstat/net-tools is deprecated. Unfortunately,
ss's '--family' argument does not accept multiple families, nor
does passing '--family' multiple times with different arguments work
either, so aa-unconfined invokes ss multiple times to gather the
different socket families.

It also fixes the invocation of netstat to use the "--protocol
inet,inet6" arguments instead, which should return the same results
as the short options.

This patch provides command line arguments to manually switch using
one tool or the other, as well as converting the invocations of ss
and netstat to not use a shell, and documents these options in the
aa-unconfined man page.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
Acked-by: John Johansen <john.johansen@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: