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 <apparmor@cboltz.de>
This commit is contained in:
Kshitij Gupta 2015-06-08 01:18:43 +05:30
parent 255ee31dd4
commit 27b0a571fc

View file

@ -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):