2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

parser: make base classes for rules using prefixes and perms and use them

Cleanup the parse code by making shared prefix and perms classes for
rules and convert rules to use them.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2021-09-04 03:28:18 -07:00
parent fdf5b062a9
commit d371458533
18 changed files with 209 additions and 150 deletions

View File

@@ -87,7 +87,7 @@ void mqueue_rule::move_conditionals(struct cond_entry *conds)
}
mqueue_rule::mqueue_rule(perms_t perms_p, struct cond_entry *conds, char *qname_p):
qtype(mqueue_unspecified), qname(qname_p), label(NULL), audit(AUDIT_UNSPECIFIED), deny(0)
qtype(mqueue_unspecified), qname(qname_p), label(NULL)
{
move_conditionals(conds);
free_cond_list(conds);
@@ -115,10 +115,7 @@ mqueue_rule::mqueue_rule(perms_t perms_p, struct cond_entry *conds, char *qname_
ostream &mqueue_rule::dump(ostream &os)
{
if (audit == AUDIT_FORCE)
os << "audit ";
if (deny)
os << "deny ";
prefix_rule_t::dump(os);
os << "mqueue ";