summaryrefslogtreecommitdiffstats
path: root/bus/bus.c
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-06-07 20:07:34 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-06-07 20:07:34 +0000
commitd062db4c27d7937ca0fb5367cb5a467554d47ee8 (patch)
tree400d5357aa6f4e8cfbaed07c8282b9c4ac66bca2 /bus/bus.c
parent3ac2e48282085f557d665df4915eaed08875fe1f (diff)
* bus/bus.c: Fix eavesdropping on method calls
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/bus/bus.c b/bus/bus.c
index 8e4f0ea0..5c277088 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -1355,21 +1355,21 @@ bus_context_check_security_policy (BusContext *context,
return FALSE;
}
- if (type == DBUS_MESSAGE_TYPE_METHOD_CALL)
+ /* Record that we will allow a reply here in the future (don't
+ * bother if the recipient is the bus or this is an eavesdropping
+ * connection). Only the addressed recipient may reply.
+ */
+ if (type == DBUS_MESSAGE_TYPE_METHOD_CALL &&
+ sender &&
+ addressed_recipient &&
+ addressed_recipient == proposed_recipient && /* not eavesdropping */
+ !bus_connections_expect_reply (bus_connection_get_connections (sender),
+ transaction,
+ sender, addressed_recipient,
+ message, error))
{
- /* Record that we will allow a reply here in the future (don't
- * bother if the recipient is the bus). Only the addressed recipient
- * may reply.
- */
- if (sender && addressed_recipient &&
- !bus_connections_expect_reply (bus_connection_get_connections (sender),
- transaction,
- sender, addressed_recipient,
- message, error))
- {
- _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n");
- return FALSE;
- }
+ _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n");
+ return FALSE;
}
_dbus_verbose ("security policy allowing message\n");