From 27b0a571fc23b28cfcf093c5f5f3aa13b472188e Mon Sep 17 00:00:00 2001 From: Kshitij Gupta Date: Mon, 8 Jun 2015 01:18:43 +0530 Subject: [PATCH] Remove re import from cleanprofile.py The following patch: - removes re import - uses apparmor.re_match_include instead of the regex which also means to use the correct regex instead of the slightly wrong one cleanprofile.py had Acked-by: Christian Boltz --- utils/apparmor/cleanprofile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/apparmor/cleanprofile.py b/utils/apparmor/cleanprofile.py index 5d490b186..33adb623f 100644 --- a/utils/apparmor/cleanprofile.py +++ b/utils/apparmor/cleanprofile.py @@ -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 @@ def delete_path_duplicates(profile, profile_other, allow, same_profile=True): 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):