From b84877b900c27d5e05af9acb184960e9846636ea Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sat, 1 Oct 2016 19:50:57 +0200 Subject: [PATCH] [09/38] Drop contains() in aamode.py 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. Acked-by: Seth Arnold --- utils/apparmor/aamode.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils/apparmor/aamode.py b/utils/apparmor/aamode.py index 4f3044b55..f6ec60738 100644 --- a/utils/apparmor/aamode.py +++ b/utils/apparmor/aamode.py @@ -123,9 +123,6 @@ def mode_contains(mode, subset): 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 @@ def log_str_to_mode(profile, string, nt_name): 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: