mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
parser: add rule merging for af_unix rules
this is reuired because af_rule merging does not take into account the potential af_unix addresses and could incorrectly merge af_unix rules. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -62,6 +62,19 @@ public:
|
||||
virtual int expand_variables(void);
|
||||
virtual int gen_policy_re(Profile &prof);
|
||||
|
||||
// inherit is_mergable() from af_rule
|
||||
virtual int cmp(rule_t const &rhs) const
|
||||
{
|
||||
int res = af_rule::cmp(rhs);
|
||||
if (res)
|
||||
return res;
|
||||
unix_rule const &trhs = (rule_cast<unix_rule const &>(rhs));
|
||||
res = null_strcmp(addr, trhs.addr);
|
||||
if (res)
|
||||
return res;
|
||||
return null_strcmp(peer_addr, trhs.peer_addr);
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual void warn_once(const char *name) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user