mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
Refactor change_profile to bring ns and none ns target into one rule
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user