Hello,

this patch drops the old RE_PROFILE_CHANGE_PROFILE regex from regex.py
and renames RE_PROFILE_CHANGE_PROFILE_2 to RE_PROFILE_CHANGE_PROFILE.
It also updates apparmor/rule/change_profile.py to use the changed name.


[ 04-drop-old-change-profile-regex.diff ]

=== modified file utils/apparmor/regex.py
--- utils/apparmor/regex.py     2015-05-09 22:06:43.414072303 +0200
+++ utils/apparmor/regex.py     2015-05-09 22:24:32.357897729 +0200
@@ -32,7 +32,6 @@
 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_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
=== modified file utils/apparmor/rule/change_profile.py
--- utils/apparmor/rule/change_profile.py       2015-05-09 22:06:43.415072245 
+0200
+++ utils/apparmor/rule/change_profile.py       2015-05-09 22:24:46.380082136 
+0200
@@ -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
 
@@ -74,7 +74,7 @@
 
     @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):



Regards,

Christian Boltz
-- 
> ==> Ich müßte das abtippen.
jetzt wird's aber heftig. Maus putt ?
# Log all the mail messages in one place.
# mail.*                    -/var/log/nadeldrucker
[> swdld AT gmx.net und Helga Mayer in postfixbuch-users]


-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to