[apparmor] [patch] [09/38] Drop contains() in aamode.py

Christian Boltz apparmor at cboltz.de
Fri Aug 12 20:48:45 UTC 2016


Hello,

after dropping the dead code in handle_children(), there's only one use
of contains() left in log_str_to_mode().

This patch changes log_str_to_mode to use mode_contains() and drops the
now unused contains() function.


[ 09-aamode-drop-contains.diff ]

=== modified file 'utils/apparmor/aamode.py'
--- utils/apparmor/aamode.py	2015-02-03 11:47:36 +0000
+++ utils/apparmor/aamode.py	2016-02-03 23:45:39 +0000
@@ -123,9 +123,6 @@
 
     return (mode & subset) == subset
 
-def contains(mode, string):
-    return mode_contains(mode, str_to_mode(string))
-
 def validate_log_mode(mode):
     if LOG_MODE_RE.search(mode):
         return True
@@ -249,7 +246,7 @@
     mode = str_to_mode(string)
     # If contains nx and nix
     #print (profile, string, nt_name)
-    if contains(mode, 'Nx'):
+    if mode_contains(mode, str_to_mode('Nx')):
         # Transform to px, cx
         match = re.search('(.+?)//(.+?)', nt_name)
         if match:




Regards,

Christian Boltz
-- 
Da hast Du doch nicht allen Ernstes erwartet, dass nach 8 Jahren
(6 davon angeblich schon stabil und produktiv benutzbar) bei dem
KDE4-Gemurkse so etwas ganz einfaches, was bei jedem anderem MUA
Standard ist, auf ein mal bei Kmail von einer Version auf die
andere funktioniert? [Thomas Lueck in opensuse-de]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160812/f9b97c70/attachment.pgp>


More information about the AppArmor mailing list