[apparmor] [patch] ignore log event if request_mask == ''

Christian Boltz apparmor at cboltz.de
Fri Dec 11 19:47:20 UTC 2015


Hello,

$subject.
We already check for None, but '' != None ;-)


References: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1525119


I propose this patch for 2.9, 2.10 and trunk.


[ 37-ignore-empty-string-request-mask.diff ]

=== modified file ./utils/apparmor/logparser.py
--- utils/apparmor/logparser.py 2015-12-08 22:39:19.920789122 +0100
+++ utils/apparmor/logparser.py 2015-12-11 20:41:11.720074915 +0100
@@ -294,7 +294,8 @@
 
             # for some reason, we get file_perm and file_inherit log events without request_mask, see
             # https://bugs.launchpad.net/apparmor/+bug/1466812/ and https://bugs.launchpad.net/apparmor/+bug/1509030
-            if e['operation'] in ['file_perm', 'file_inherit'] and e['request_mask'] is None:
+            # request_mask can also be '', see https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1525119
+            if e['operation'] in ['file_perm', 'file_inherit'] and not e['request_mask']:
                 self.debug_logger.debug('UNHANDLED (missing request_mask): %s' % e)
                 return None
 


Regards,

Christian Boltz
-- 
Die beste SuSE glaub ich Dir gern, von mir aus auch gern die beste
Linux Distro, aber die beste Susi kann ich dir nicht unterschreiben...
Da gibt es Features, die wird die SuSE AG nie in eine Linux-Distro
unterbringen ;-) [Manfred Tremmel in suse-linux]




More information about the AppArmor mailing list