mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: add rule merging for mqueue rules
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
0f660828e1
commit
ca976bf5cb
1 changed files with 16 additions and 0 deletions
|
@ -107,6 +107,22 @@ public:
|
|||
virtual int expand_variables(void);
|
||||
virtual int gen_policy_re(Profile &prof);
|
||||
|
||||
virtual bool is_mergeable(void) { return true; }
|
||||
virtual int cmp(rule_t const &rhs) const
|
||||
{
|
||||
int res = perms_rule_t::cmp(rhs);
|
||||
if (res)
|
||||
return res;
|
||||
mqueue_rule const &trhs = rule_cast<mqueue_rule const &>(rhs);
|
||||
res = qtype - trhs.qtype;
|
||||
if (res)
|
||||
return res;
|
||||
res = null_strcmp(qname, trhs.qname);
|
||||
if (res)
|
||||
return res;
|
||||
return null_strcmp(label, trhs.label);
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual void warn_once(const char *name) override;
|
||||
void validate_qname(void);
|
||||
|
|
Loading…
Add table
Reference in a new issue