From b65fbda092d80f9c59635cd0722c61164c1d6c32 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 9 May 2024 21:54:36 +0200 Subject: [PATCH] Add 'details' labeled section to RE_PROFILE_PIVOT_ROOT --- utils/apparmor/regex.py | 2 +- utils/test/test-regex_matches.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/apparmor/regex.py b/utils/apparmor/regex.py index b342c4b49..256b5acb1 100644 --- a/utils/apparmor/regex.py +++ b/utils/apparmor/regex.py @@ -50,7 +50,7 @@ RE_PROFILE_DBUS = re.compile(RE_AUDIT_DENY + r'(dbus\s*,|dbus(?P
\s+[^#] RE_PROFILE_MOUNT = re.compile(RE_AUDIT_DENY + r'((?Pmount|remount|umount|unmount)(?P
\s+[^#]*)?\s*,)' + RE_EOL) RE_PROFILE_SIGNAL = re.compile(RE_AUDIT_DENY + r'(signal\s*,|signal(?P
\s+[^#]*)\s*,)' + RE_EOL) RE_PROFILE_PTRACE = re.compile(RE_AUDIT_DENY + r'(ptrace\s*,|ptrace(?P
\s+[^#]*)\s*,)' + RE_EOL) -RE_PROFILE_PIVOT_ROOT = re.compile(RE_AUDIT_DENY + r'(pivot_root\s*,|pivot_root\s+[^#]*\s*,)' + RE_EOL) +RE_PROFILE_PIVOT_ROOT = re.compile(RE_AUDIT_DENY + r'(pivot_root\s*,|pivot_root(?P
\s+[^#]*),)' + RE_EOL) RE_PROFILE_UNIX = re.compile(RE_AUDIT_DENY + r'(unix\s*,|unix(?P
\s+[^#]*)\s*,)' + RE_EOL) RE_PROFILE_USERNS = re.compile(RE_AUDIT_DENY + r'(userns\s*,|userns(?P
\s+[^#]*)\s*,)' + RE_EOL) RE_PROFILE_MQUEUE = re.compile(RE_AUDIT_DENY + r'(mqueue\s*,|mqueue(?P
\s+[^#]*)\s*,)' + RE_EOL) diff --git a/utils/test/test-regex_matches.py b/utils/test/test-regex_matches.py index da83182a2..cd081dedf 100644 --- a/utils/test/test-regex_matches.py +++ b/utils/test/test-regex_matches.py @@ -316,12 +316,12 @@ class AARegexPivotRoot(AARegexTest): self.regex = aa.RE_PROFILE_PIVOT_ROOT tests = ( - (' pivot_root,', (None, None, 'pivot_root,', None)), - (' audit pivot_root,', ('audit', None, 'pivot_root,', None)), - (' pivot_root oldroot=/new/old,', (None, None, 'pivot_root oldroot=/new/old,', None)), - (' pivot_root oldroot=/new/old /new,', (None, None, 'pivot_root oldroot=/new/old /new,', None)), - (' pivot_root oldroot=/new/old /new -> child,', (None, None, 'pivot_root oldroot=/new/old /new -> child,', None)), - (' audit pivot_root oldroot=/new/old /new -> child,', ('audit', None, 'pivot_root oldroot=/new/old /new -> child,', None)), + (' pivot_root,', (None, None, 'pivot_root,', None, None)), + (' audit pivot_root,', ('audit', None, 'pivot_root,', None, None)), + (' pivot_root oldroot=/new/old,', (None, None, 'pivot_root oldroot=/new/old,', 'oldroot=/new/old', None)), + (' pivot_root oldroot=/new/old /new,', (None, None, 'pivot_root oldroot=/new/old /new,', 'oldroot=/new/old /new', None)), + (' pivot_root oldroot=/new/old /new -> child,', (None, None, 'pivot_root oldroot=/new/old /new -> child,', 'oldroot=/new/old /new -> child', None)), + (' audit pivot_root oldroot=/new/old /new -> child,', ('audit', None, 'pivot_root oldroot=/new/old /new -> child,', 'oldroot=/new/old /new -> child', None)), ('pivot_root', False), # comma missing