mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: add rule merging for dbus rules
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
5e713276ca
commit
c5f2fcbb95
1 changed files with 26 additions and 0 deletions
|
@ -62,6 +62,32 @@ 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;
|
||||
dbus_rule const &trhs = (rule_cast<dbus_rule const &>(rhs));
|
||||
res = null_strcmp(bus, trhs.bus);
|
||||
if (res)
|
||||
return res;
|
||||
res = null_strcmp(name, trhs.name);
|
||||
if (res)
|
||||
return res;
|
||||
res = null_strcmp(peer_label, trhs.peer_label);
|
||||
if (res)
|
||||
return res;
|
||||
res = null_strcmp(path, trhs.path);
|
||||
if (res)
|
||||
return res;
|
||||
res = null_strcmp(interface, trhs.interface);
|
||||
if (res)
|
||||
return res;
|
||||
return null_strcmp(member, trhs.member);
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
virtual void warn_once(const char *name) override;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue