const boost::string_ref &_path,
const boost::string_ref &_member,
const boost::string_ref &_name,
- bool _is_name_prefix) const {
+ bool _is_name_prefix,
+ Decision decision) const {
if (_type != MessageType::ANY && _type != type)
return false;
return lhs.empty() || rhs.empty() || lhs == rhs;
};
+ /* A special clause for no-interface messages. If an allow rule is for some interface
+ * and message has no interface we have to ignore the rule.
+ * See dbus/bus/policy.c:bus_client_policy_check_can_send() for reference.
+ */
+ if (interface.empty() && !_interface.empty() && Decision::DENY != decision)
+ return false;
+
if (!equal_or_empty(_interface, interface))
return false;
const boost::string_ref &_path,
const boost::string_ref &_member,
const boost::string_ref &_name,
- bool _is_name_prefix) const;
+ bool _is_name_prefix,
+ Decision decision) const;
};
class MatchItemSend : public MatchItemSR {