mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 15:55:46 +00:00
parser: fix priority for file rules.
File rules could drop priority info when rule matched a rule that was the same except for having different priority. For now fix this by treating them as a different rule. The priority was also be dropped when add_prefix was used to add the priority during the parse resulting in file rules always getting a default priority of 0. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -54,6 +54,9 @@ static int file_comp(const void *c1, const void *c2)
|
||||
if ((*e1)->audit != (*e2)->audit)
|
||||
return (*e1)->audit < (*e2)->audit ? -1 : 1;
|
||||
|
||||
if ((*e1)->priority != (*e2)->priority)
|
||||
return (*e2)->priority - (*e1)->priority;
|
||||
|
||||
return strcmp((*e1)->name, (*e2)->name);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user