On Fri, May 08, 2015 at 11:56:46PM +0200, Christian Boltz wrote:
> Hello,
> 
> quote_if_needed() will be used by the upcoming ChangeProfileRule class,
> which means it must moved out of aa.py to avoid an import loop.
> rule/__init__.py looks like a better place.
> 
> Also re-import quote_if_needed() into aa.py because it's still needed
> there by various functions.
> 
> 
> [ 02-move-quote_if_needed.diff ]

Acked-by: Seth Arnold <[email protected]>


> +++ utils/apparmor/rule/__init__.py     2015-05-08 23:46:26.461767822 +0200
> +def quote_if_needed(data):
> +    '''quote data if it contains whitespace'''
> +    if ' ' in data:
> +        data = '"' + data + '"'
> +    return data

This looks broken to me; the following profile fails to compile:


profile foo {
  file "/foo " bar" r,
}       

while the following profile compiles fine:

profile foo {
  file "/foo \" bar" r,
}       

The quoting mechanism should also escape any " marks within.

Thanks

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to