[apparmor] [PATCH 6/9] Update parsing of the 'hat' and 'profile' keyword to use SUB_NAME

Steve Beattie steve at nxnw.org
Tue Jan 3 19:57:21 UTC 2012


On Tue, Dec 27, 2011 at 07:01:49PM -0800, John Johansen wrote:
> Change how we handle the parsing of the hat and profile keywords this allows
> us to get rid of the SUB_NAME2 start condition because the the whitespace
> that is allowed by these rules are now consumed by matching the keyword
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>
> ---
>  parser/parser_lex.l  |   39 +++++++++------------------------------
>  parser/parser_misc.c |    1 -
>  2 files changed, 9 insertions(+), 31 deletions(-)
> 
> diff --git a/parser/parser_lex.l b/parser/parser_lex.l
> index 5cb24fb..64b6a2e 100644
> --- a/parser/parser_lex.l
> +++ b/parser/parser_lex.l
> @@ -186,7 +186,8 @@ IP		{NUMBER}\.{NUMBER}\.{NUMBER}\.{NUMBER}
>  ALLOWED_QUOTED_ID 	[^\0"]|\\\"
>  QUOTED_ID	\"{ALLOWED_QUOTED_ID}*\"
>  
> -HAT		hat[ \t]+
> +HAT		hat{WS}*
> +PROFILE		profile{WS}*

Should these match {WS}+ to ensure there's a trailing space separator?

>  KEYWORD         [[:alpha:]_]+
>  VARIABLE_NAME	[[:alpha:]][[:alnum:]_]*
>  SET_VAR_PREFIX  @

-- 
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: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20120103/e3e01b6e/attachment.pgp>


More information about the AppArmor mailing list