mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 23:35:37 +00:00
parser: add permission merging
By changing the compare function from each rule to use class_rule_t, instead of perms_rule_t, we temporarily ignore if permissions are different. If every rule attribute is the same, then the permissions can be merged. This is done at the perms_rule_t's level. Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
@@ -110,7 +110,8 @@ public:
|
||||
virtual bool is_mergeable(void) { return true; }
|
||||
virtual int cmp(rule_t const &rhs) const
|
||||
{
|
||||
int res = perms_rule_t::cmp(rhs);
|
||||
/* use class_rule_t instead of perms_rule_t to merge perms */
|
||||
int res = class_rule_t::cmp(rhs);
|
||||
if (res)
|
||||
return res;
|
||||
mqueue_rule const &trhs = rule_cast<mqueue_rule const &>(rhs);
|
||||
|
Reference in New Issue
Block a user