[apparmor] [Patch][parser]

John Johansen john.johansen at canonical.com
Wed Sep 24 22:02:02 UTC 2014


On 09/24/2014 01:00 PM, Tyler Hicks wrote:
> 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.
> 
yes, well not just bug fixes should have tests

I just wanted to float this before I got the tests done

> (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




More information about the AppArmor mailing list