internal bugfix: handle no-interface messages 36/206336/4
authorAdrian Szyndela <adrian.s@samsung.com>
Thu, 16 May 2019 12:39:20 +0000 (14:39 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 17 May 2019 09:35:57 +0000 (11:35 +0200)
commit16719e6a1c9c5ec6f74c7939082c5263014edea4
treea96f39fa6158eb301c9a7b8e341546b5c2218457
parent3c5fd8246e295562148841868b616ebb6848e0f4
internal bugfix: handle no-interface messages

No-interface messages should be handled in a special way.
Dbus says in bus/policy.c:

 The interface is optional in messages. For allow rules, if the message
 has no interface we want to skip the rule (and thus not allow);
 for deny rules, if the message has no interface we want to use the
 rule (and thus deny).

For example, a rule of type:
 <deny send_type="method_call" send_interface="foo.bar"/>
should:
- deny method_calls with foo.bar interface;
- deny method_calls with no interface.
A rule of type:
 <allow send_type="method_call" send_interface="foo.bar"/>
should:
- allow method_calls with foo.bar interface;
- not allow method_calls with not interface (the rule should be ignored).

The point is to make libdbuspolicy work as close as possible to how
dbus-daemon works with policies.

Change-Id: I99563d3728047a67fa4719948719a2df9c5d9f97
src/internal/policy.cpp
src/internal/policy.hpp
src/internal/storage_backend_serialized.cpp