2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 05:47:59 +00:00

[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 <seth.arnold@canonical.com>
This commit is contained in:
Christian Boltz 2016-10-01 19:50:57 +02:00
parent b8171d547e
commit b84877b900

View File

@ -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: