2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +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

@@ -46,6 +46,13 @@ public:
free(peer_addr);
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on unix rules";
return false;
}
return true;
};
virtual bool has_peer_conds(void) {
return af_rule::has_peer_conds() || peer_addr;
}