[apparmor] [patch] aa.py: use correct variable in match_net_includes()
Christian Boltz
apparmor at cboltz.de
Sun Oct 19 19:19:08 UTC 2014
Hello,
match_net_includes() in aa.py gets "nettype" as parameter, but then uses
"type" when calling valid_include(). "type" is a global variable, but not
what we want to use here ;-)
I noticed this while debugging https://bugs.launchpad.net/apparmor/+bug/1380368
(but this patch does not fix it, at least not alone)
<rant>That's why I like PHP - it would have required an explicit
"global type" statement - or, without it, print an "undefined variable 'type'"
warning.</rant>
=== modified file 'utils/apparmor/aa.py'
--- utils/apparmor/aa.py 2014-10-16 20:03:42 +0000
+++ utils/apparmor/aa.py 2014-10-19 19:09:49 +0000
@@ -2225,8 +2225,8 @@
def match_net_includes(profile, family, nettype):
newincludes = []
for incname in include.keys():
- if valid_include(profile, incname) and match_net_include(incname, family, type):
+ if valid_include(profile, incname) and match_net_include(incname, family, nettype):
newincludes.append(incname)
return newincludes
Regards,
Christian Boltz
--
[IP-Adresse von ppp0 mit system() ermitteln]
Dazu Perl zu verwenden, ähnelt sicherlich ein wenig der Spatzenjagd
mit großkalibrigen Langrohrgeschützen...;-)
[Christian Schmidt in suse-linux]
More information about the AppArmor
mailing list