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

John Johansen john.johansen at canonical.com
Tue Jan 3 12:01:37 UTC 2012


On 12/28/2011 11:42 AM, John Johansen wrote:
> 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
>

So for the time being I split it into the following two patches



More information about the AppArmor mailing list