[apparmor] [PATCH 3/5] Combine hat and local profile parsing intothe same base rule as profile parsing.

John Johansen john.johansen at canonical.com
Tue Nov 23 09:57:39 GMT 2010


On 11/23/2010 01:38 AM, Seth Arnold wrote:
> Please forgive my rubbish quoting.
> 
> +local_profile:   TOK_PROFILE profile_base
> +{
> +
> +struct codomain *cod = $2;
> +
> +if ($2)
> +PDEBUG("Matched: local profile %s { ... }\n", cod->name);
> +cod->local = 1;
> +$$ = cod;
> +};
> +
> +hat: hat_start profile_base
> +{
> +struct codomain *cod = $2;
> +if ($2)
> +PDEBUG("Matched: hat %s { ... }\n", code->name);
> +
> +cod->flags.hat = 1;
> +$$ = cod;
>  };
> 
> 
> If $2 isn't true, cod->local = 1; or cod->flags.hat = 1;  will blow up mightily, may as well remove the conditional?
> 
true enough and its won't happen in this rule because of yyerror in other rules.

thanks Seth



More information about the AppArmor mailing list