2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 22:05:27 +00:00

parser: add flags to rule_t

In preparation for file rules and rule duplication removal add
flags to rule_t with the first flag indicating if the rule is
deleted.

We do this instead of actually deleting the rule so we can hold
on to the rule for debug and printing output in the future.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2021-09-19 00:59:45 -07:00
parent 1acc90e06a
commit b061155c9a
4 changed files with 20 additions and 3 deletions

View File

@@ -843,6 +843,8 @@ int clear_and_convert_entry(std::string& buffer, char *entry)
int post_process_policydb_ents(Profile *prof)
{
for (RuleList::iterator i = prof->rule_ents.begin(); i != prof->rule_ents.end(); i++) {
if ((*i)->flags & RULE_FLAG_DELETED)
continue;
if ((*i)->gen_policy_re(*prof) == RULE_ERROR)
return FALSE;
}