mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user