[apparmor] [Patch][parser]

Tyler Hicks tyhicks at canonical.com
Wed Sep 24 20:00:27 UTC 2014


On 2014-09-24 11:32:33, John Johansen wrote:
> Fix: Parser error when using regex profile names in IPC rules
> 
> BugLink: http://bugs.launchpad.net/bugs/1373085
> 
> The parser fails to accept certain characters, even when escaped or quoted
> as part of the profile or label name in ipc rules. This is due to the
> lexer not accepting those characters as part of the input pattern.
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Bug fixes like this should include tests.

(I'm guilty of sending a parser fix out last week without including
tests. Steve thoughtfully included a set of tests with his ack. If only
I were as nice as Steve...)

Tyler

> 
> ---
> 
> === modified file 'parser/parser_lex.l'
> --- parser/parser_lex.l	2014-09-03 22:05:56 +0000
> +++ parser/parser_lex.l	2014-09-24 18:24:06 +0000
> @@ -211,9 +211,10 @@
>  IDS		{ID}+
>  POST_VAR_ID_CHARS	[^ \t\n"!,]{-}[=\+]
>  POST_VAR_ID 	{POST_VAR_ID_CHARS}|(,{POST_VAR_ID_CHARS})
> -LIST_VALUE_ID_CHARS	[^ \t\n"!,]{-}[()]
> +LIST_VALUE_ID_CHARS	([^ \t\n"!,]{-}[()]|\\[ ]|\\\t|\\\"|\\!|\\,|\\\(|\\\))
> +LIST_VALUE_QUOTED_ID_CHARS [^\0"]|\\\"
>  LIST_VALUE_ID	{LIST_VALUE_ID_CHARS}+
> -QUOTED_LIST_VALUE_ID	{LIST_VALUE_ID}|\"{LIST_VALUE_ID}\"
> +QUOTED_LIST_VALUE_ID	\"{LIST_VALUE_QUOTED_ID_CHARS}+\"
>  ID_CHARS_NOEQ	[^ \t\n"!,]{-}[=]
>  LEADING_ID_CHARS_NOEQ [^ \t\n"!,]{-}[=()+&]
>  ID_NOEQ		{ID_CHARS_NOEQ}|(,{ID_CHARS_NOEQ})
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
-------------- 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/20140924/9c37d3bc/attachment.pgp>


More information about the AppArmor mailing list