[apparmor] [utils] [patch] Remove re import from cleanprofile.py
Kshitij Gupta
kgupta8592 at gmail.com
Sun Jun 7 18:15:50 UTC 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150607/0bd6d328/attachment.html>
More information about the AppArmor
mailing list