Hello,

The following patch:
- removes re import
- uses apparmor.re_match_include instead of the regex


=== modified file 'utils/apparmor/cleanprofile.py'
--- utils/apparmor/cleanprofile.py      2015-06-07 17:58:53 +0000
+++ utils/apparmor/cleanprofile.py      2015-06-07 18:05:50 +0000
@@ -11,8 +11,6 @@
 #    GNU General Public License for more details.
 #
 # ----------------------------------------------------------------------
-import re
-
 import apparmor.aa as apparmor

 class Prof(object):
@@ -92,7 +90,7 @@
                     if not same_profile:
                         deleted.append(entry)
                 continue
-            if re.search('#?\s*include', rule) or
re.search('#?\s*include', entry):
+            if apparmor.re_match_include(rule) or
apparmor.re_match_include(entry):
                 continue
             # Check if the rule implies entry
             if apparmor.matchliteral(rule, entry):


Thanks.

Regards,

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

Reply via email to