mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Drop old RE_PROFILE_CHANGE_PROFILE regex from regex.py
Also rename RE_PROFILE_CHANGE_PROFILE_2 to RE_PROFILE_CHANGE_PROFILE and update apparmor/rule/change_profile.py to use the changed name. Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
parent
98383c0816
commit
534715c2e2
2 changed files with 3 additions and 4 deletions
|
@ -32,7 +32,6 @@ RE_PROFILE_PATH = '(?P<%s>(/\S+|"/[^"]+"))' # filename (starting with '
|
|||
RE_PROFILE_END = re.compile('^\s*\}' + RE_EOL)
|
||||
RE_PROFILE_CAP = re.compile(RE_AUDIT_DENY + 'capability(?P<capability>(\s+\S+)+)?' + RE_COMMA_EOL)
|
||||
RE_PROFILE_LINK = re.compile(RE_AUDIT_DENY + 'link\s+(((subset)|(<=))\s+)?([\"\@\/].*?"??)\s+->\s*([\"\@\/].*?"??)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_CHANGE_PROFILE = re.compile('^\s*change_profile\s+->\s*("??.+?"??)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_ALIAS = re.compile('^\s*alias\s+("??.+?"??)\s+->\s*("??.+?"??)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_RLIMIT = re.compile('^\s*set\s+rlimit\s+(.+)\s+(<=)?\s*(.+)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_BOOLEAN = re.compile('^\s*(\$\{?\w*\}?)\s*=\s*(true|false)\s*,?' + RE_EOL, flags=re.IGNORECASE)
|
||||
|
@ -73,7 +72,7 @@ RE_PROFILE_START = re.compile(
|
|||
RE_EOL)
|
||||
|
||||
|
||||
RE_PROFILE_CHANGE_PROFILE_2 = re.compile(
|
||||
RE_PROFILE_CHANGE_PROFILE = re.compile(
|
||||
RE_AUDIT_DENY +
|
||||
'change_profile' +
|
||||
'(\s+' + RE_PROFILE_PATH % 'execcond' + ')?' + # optionally exec condition
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
from apparmor.regex import RE_PROFILE_CHANGE_PROFILE_2, strip_quotes
|
||||
from apparmor.regex import RE_PROFILE_CHANGE_PROFILE, strip_quotes
|
||||
from apparmor.common import AppArmorBug, AppArmorException
|
||||
from apparmor.rule import BaseRule, BaseRuleset, parse_modifiers, quote_if_needed
|
||||
|
||||
|
@ -73,7 +73,7 @@ class ChangeProfileRule(BaseRule):
|
|||
|
||||
@classmethod
|
||||
def _match(cls, raw_rule):
|
||||
return RE_PROFILE_CHANGE_PROFILE_2.search(raw_rule)
|
||||
return RE_PROFILE_CHANGE_PROFILE.search(raw_rule)
|
||||
|
||||
@classmethod
|
||||
def _parse(cls, raw_rule):
|
||||
|
|
Loading…
Add table
Reference in a new issue