summaryrefslogtreecommitdiffstats
path: root/bus/policy.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-10-10 02:42:21 +0000
committerHavoc Pennington <hp@redhat.com>2003-10-10 02:42:21 +0000
commit6a65f4802e95ba442c520f8e225da837e0a9f73b (patch)
tree734e69da90869b3788d381e75911d720ad8cfd0f /bus/policy.c
parent79d03f94fec278d270a33792aeffb33ba239bb01 (diff)
2003-10-09 Havoc Pennington <hp@redhat.com>
Make matching rules theoretically work (add parser). * bus/bus.c (bus_context_check_security_policy): fix up to handle the case where destination is explicitly specified as bus driver and someone else is eavesdropping. * bus/policy.c (bus_client_policy_check_can_receive): fix up definition of eavesdropping and assertion * tools/dbus-send.c (main): use dbus_message_type_from_string * bus/signals.c (bus_match_rule_parse): implement * dbus/dbus-message.c (dbus_message_type_from_string): new * dbus/dbus-errors.h (DBUS_ERROR_MATCH_RULE_INVALID): add
Diffstat (limited to 'bus/policy.c')
-rw-r--r--bus/policy.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/bus/policy.c b/bus/policy.c
index 2d462fb6..71137ca9 100644
--- a/bus/policy.c
+++ b/bus/policy.c
@@ -913,6 +913,9 @@ bus_client_policy_check_can_send (BusClientPolicy *policy,
return allowed;
}
+/* See docs on what the args mean on bus_context_check_security_policy()
+ * comment
+ */
dbus_bool_t
bus_client_policy_check_can_receive (BusClientPolicy *policy,
BusRegistry *registry,
@@ -924,20 +927,10 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy,
DBusList *link;
dbus_bool_t allowed;
dbus_bool_t eavesdropping;
-
- /* NULL sender, proposed_recipient means the bus driver. NULL
- * addressed_recipient means the message didn't specify an explicit
- * target. If proposed_recipient is NULL, then addressed_recipient
- * is also NULL but is implicitly the bus driver.
- */
- _dbus_assert (proposed_recipient == NULL ||
- (dbus_message_get_destination (message) == NULL ||
- addressed_recipient != NULL));
-
eavesdropping =
- (proposed_recipient == NULL || /* explicitly to bus driver */
- (addressed_recipient && addressed_recipient != proposed_recipient)); /* explicitly to a different recipient */
+ addressed_recipient != proposed_recipient &&
+ dbus_message_get_destination (message) != NULL;
/* policy->rules is in the order the rules appeared
* in the config file, i.e. last rule that applies wins