[apparmor] [PATCH 12/14] Refactor change_profile to bring ns and none ns target into one rule

Steve Beattie steve at nxnw.org
Mon Jun 8 19:28:38 UTC 2015


On Thu, Jun 04, 2015 at 03:56:41AM -0700, John Johansen wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Steve Beattie <steve at nxnw.org>, thanks.

> diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y
> index 8d90332..b3083d5 100644
> --- a/parser/parser_yacc.y
> +++ b/parser/parser_yacc.y
> @@ -1516,21 +1516,10 @@ change_profile: change_profile_head TOK_END_OF_RULE
>  		$$ = entry;
>  	};
>  
> -change_profile:	change_profile_head TOK_ARROW TOK_ID TOK_END_OF_RULE
> +change_profile:	change_profile_head TOK_ARROW opt_ns TOK_ID TOK_END_OF_RULE
>  	{
>  		struct cod_entry *entry;
> -		PDEBUG("Matched change_profile: tok_id (%s)\n", $3);
> -		entry = new_entry(NULL, $3, AA_CHANGE_PROFILE, $1);
> -		if (!entry)
> -			yyerror(_("Memory allocation error."));
> -		PDEBUG("change_profile.entry: (%s)\n", entry->name);
> -		$$ = entry;
> -	};
> -
> -change_profile:	change_profile_head TOK_ARROW ns_id TOK_ID TOK_END_OF_RULE
> -	{
> -		struct cod_entry *entry;
> -		PDEBUG("Matched change_profile: tok_id (%s:%s)\n", $3, $4);
> +		PDEBUG("Matched change_profile: tok_id (:%s://%s)\n", $3 ? $3 : "", $4);
>  		entry = new_entry($3, $4, AA_CHANGE_PROFILE, $1);
>  		if (!entry)
>  			yyerror(_("Memory allocation error."));
> @@ -1538,7 +1527,6 @@ change_profile:	change_profile_head TOK_ARROW ns_id TOK_ID TOK_END_OF_RULE
>  		$$ = entry;
>  	};
>  
> -
>  capability:	TOK_CAPABILITY caps TOK_END_OF_RULE
>  	{
>  		if ($2 == 0) {
> -- 
> 2.1.4
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

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


More information about the AppArmor mailing list