[apparmor] [patch] Make profile flags more whitespace tolerant
Steve Beattie
steve at nxnw.org
Sun Jul 5 17:36:34 UTC 2015
On Sun, Jul 05, 2015 at 04:52:34PM +0200, Christian Boltz wrote:
> as shown in profile/flags/flags_ok_whitespace.sd, the parser is quite
> tolerant to additional or missing whitespace around flags=, while the
> tools are more strict.
>
> This patch updates the RE_PROFILE_START regex to follow this tolerance.
>
>
> [ 66-make-flags-whitespace-tolerant.diff ]
>
> === modified file utils/apparmor/regex.py
> --- utils/apparmor/regex.py 2015-06-18 23:50:22.428586163 +0200
> +++ utils/apparmor/regex.py 2015-07-05 16:13:33.975309394 +0200
> @@ -68,7 +68,7 @@
> '|' + # or
> '(' + 'profile' + '\s+' + RE_PROFILE_NAME % 'namedprofile' + '(\s+' + RE_PROFILE_PATH % 'attachment' + ')?' + ')' + # 'profile', profile name, optionally attachment
> ')' +
> - '\s+((flags=)?\((?P<flags>.+)\)\s+)?\{' +
> + '\s+((flags\s*=\s*)?\((?P<flags>.+)\)\s*)?\{' +
> RE_EOL)
Acked-by: Steve Beattie <steve at nxnw.org>.
No changes to utils/test/test-regex_matches.py to confirm that the regex
works as expected?
--
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: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150705/ca244559/attachment-0001.pgp>
More information about the AppArmor
mailing list