File aa-unconfined-fix-netstat-call-2.10r3380.diff of Package apparmor

------------------------------------------------------------
revno: 3380
committer: Steve Beattie <sbeattie@ubuntu.com>
branch nick: 2.10
timestamp: Mon 2017-01-09 09:22:58 -0800
message:
  Subject: utils/aa-unconfined: fix netstat invocation regression
  
  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 fixes the invocation of netstat to use the "--protocol
  inet,inet6" arguments instead, which should return the same results
  as the short options.
  
  Signed-off-by: Steve Beattie <steve@nxnw.org>
  Acked-by: Christian Boltz <apparmor@cboltz.de>


=== modified file 'utils/aa-unconfined'
--- utils/aa-unconfined	2016-12-05 09:21:27 +0000
+++ utils/aa-unconfined	2017-01-09 17:22:58 +0000
@@ -46,10 +46,10 @@
     regex_tcp_udp = re.compile(r"^(tcp|udp|raw)6?\s+\d+\s+\d+\s+\S+\:(\d+)\s+\S+\:(\*|\d+)\s+(LISTEN|\d+|\s+)\s+(\d+)\/(\S+)")
     import subprocess
     if sys.version_info < (3, 0):
-        output = subprocess.check_output("LANG=C netstat -nlp46", shell=True).split("\n")
+        output = subprocess.check_output("LANG=C netstat -nlp --protocol inet,inet6", shell=True).split("\n")
     else:
         #Python3 needs to translate a stream of bytes to string with specified encoding
-        output = str(subprocess.check_output("LANG=C netstat -nlp46", shell=True), encoding='utf8').split("\n")
+        output = str(subprocess.check_output("LANG=C netstat -nlp --protocol inet,inet6", shell=True), encoding='utf8').split("\n")
 
     for line in output:
         match = regex_tcp_udp.search(line)


vim:ft=diff
openSUSE Build Service is sponsored by