[apparmor] [PATCH 8/9] Convert FLAGS_MODE start condition to a generic list of values start cond

John Johansen john.johansen at canonical.com
Wed Dec 28 19:42:03 UTC 2011


On 12/27/2011 08:32 PM, Seth Arnold wrote:
> On Tue, Dec 27, 2011 at 7:01 PM, John Johansen
> <john.johansen at canonical.com>  wrote:
>> Signed-off-by: John Johansen<john.johansen at canonical.com>
>> ---
>>   parser/parser_lex.l  |   41 ++++++++++++++++++++++++-----------------
>>   parser/parser_misc.c |    2 --
>>   parser/parser_yacc.y |   21 +++++++++------------
>>   3 files changed, 33 insertions(+), 31 deletions(-)
>>
>> diff --git a/parser/parser_lex.l b/parser/parser_lex.l
>> index 1d59f43..fc787c2 100644
>> --- a/parser/parser_lex.l
>> +++ b/parser/parser_lex.l
>> @@ -180,11 +180,13 @@ MODES             {MODE_CHARS}+
>>   WS             [[:blank:]]
>>   NUMBER         [[:digit:]]+
>>   ID             [^ \t\n"!,]|(,[^ \t\n"!])
>> +LIST_VALUE_ID  [^ \t\n"!,()]|([^ \t\n"!(),])
>>   POST_VAR_ID    [^ =\+\t\n"!,]|(,[^ =\+\t\n"!])
>
> The added regexps look like they should compile identically to me:
>
>   [^ \t\n"!,()]
> ([^ \t\n"!(),])
>
> I think you probably meant to mimic the lines above and below it and move
> the comma outside the square brackets, like this instead:
>
> +LIST_VALUE_ID  [^ \t\n"!,()]|(,[^ \t\n"!()])
>
yep

> (Though I'd probably be happier if all three lines were re-written
> like this:
>
> IDH [^ \t\n"!,()]
> ID IDH|(,IDH)
> LIST_VALUE_ID IDH|(,IDH)
> POST_VAR_IDH [^ =\+\t\n"!,]
> POST_VAR_ID POST_VAR_IDH|(,POST_VAR_IDH)
>
> _IDH variants for "helper"; nearly doubling the lines vs making sure a
> single comma is added to the first portion unchanged...)

hrmmm, I'll take another look at cleaning up and refactoring these

thanks



More information about the AppArmor mailing list