[apparmor] [patch] Drop unused escape() function from aa.py

Steve Beattie steve at nxnw.org
Fri Jun 17 06:37:07 UTC 2016


On Thu, Jun 16, 2016 at 10:32:53PM +0200, Christian Boltz wrote:
> Besides being unused, this function contains a broken regex.
> 
> References: https://bugs.launchpad.net/bugs/1593324
> 
> [ 01-drop-unused-escape-function.diff ]

LGTM. Acked-by: Steve Beattie <steve at nxnw.org>. Thanks!

> === modified file 'utils/apparmor/aa.py'
> --- utils/apparmor/aa.py        2016-06-01 19:04:13 +0000
> +++ utils/apparmor/aa.py        2016-06-16 20:28:09 +0000
> @@ -3135,14 +3135,6 @@
>      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 = []

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160616/550ddac5/attachment.pgp>


More information about the AppArmor mailing list