2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: consolidate rule class handling into aa_class

Instead of having each rule individually handle the class info
introduce a class_rule_t into the hierarchy and consolidate.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2021-09-10 13:37:54 -07:00
parent 30206fc11e
commit a2d56c3c74
12 changed files with 100 additions and 33 deletions

View File

@@ -190,9 +190,27 @@ public:
};
class perms_rule_t: public prefix_rule_t {
class class_rule_t: public prefix_rule_t {
public:
perms_rule_t(): perms(0) { };
int aa_class;
class_rule_t(int c) {
aa_class = c;
}
virtual ostream &dump(ostream &os) {
prefix_rule_t::dump(os);
os << aa_class_table[aa_class];
return os;
}
};
class perms_rule_t: public class_rule_t {
public:
perms_rule_t(int c): class_rule_t(c), perms(0) { };
/* defaut perms, override/mask off if none default used */
virtual ostream &dump(ostream &os) {