mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
Drop unused escape() function from aa.py
Besides being unused, this function contains a broken regex. References: https://bugs.launchpad.net/bugs/1593324 Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
@@ -3135,14 +3135,6 @@ def store_list_var(var, list_var, value, var_operation, filename):
|
||||
else:
|
||||
raise AppArmorException(_('Unknown variable operation %(operation)s for variable %(variable)s in %(file)s') % { 'operation': var_operation, 'variable': list_var, 'file': filename })
|
||||
|
||||
|
||||
def escape(escape):
|
||||
escape = strip_quotes(escape)
|
||||
escape = re.sub('((?<!\\))"', r'\1\\', escape)
|
||||
if re.search('(\s|^$|")', escape):
|
||||
return '"%s"' % escape
|
||||
return escape
|
||||
|
||||
def write_header(prof_data, depth, name, embedded_hat, write_flags):
|
||||
pre = ' ' * int(depth * 2)
|
||||
data = []
|
||||
|
Reference in New Issue
Block a user