diff options
author | Havoc Pennington <hp@redhat.com> | 2003-10-14 22:16:03 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-10-14 22:16:03 +0000 |
commit | 3251264ac483680b4a5fe808729f7e3b34f41fd4 (patch) | |
tree | 0b2a953be7b1a858c5759158e834de3d2d1b763e /bus/connection.c | |
parent | b704a068a92c00b50e7d5f33ef6c8e1c3a87ceae (diff) |
2003-10-14 Havoc Pennington <hp@redhat.com>
* bus/bus.c (bus_context_check_security_policy): revamp this to
work more sanely with new policy-based requested reply setup
* bus/connection.c (bus_transaction_send_from_driver): set bus
driver messages as no reply
* bus/policy.c (bus_client_policy_check_can_receive): handle a
requested_reply attribute on allow/deny rules
* bus/system.conf: add <allow requested_reply="true"/>
* bus/driver.c (bus_driver_handle_message): fix check for replies
sent to the bus driver, which was backward. How did this ever work
at all though? I think I'm missing something.
* dbus/dbus-message.c (decode_header_data): require error and
method return messages to have a reply serial field to be valid
(_dbus_message_loader_queue_messages): break up this function;
validate that reply serial and plain serial are nonzero;
clean up the OOM/error handling.
(get_uint_field): don't return -1 from this
(dbus_message_create_header): fix signed/unsigned bug
* bus/connection.c (bus_connections_expect_reply): save serial of
the incoming message, not reply serial
Diffstat (limited to 'bus/connection.c')
-rw-r--r-- | bus/connection.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bus/connection.c b/bus/connection.c index 2ae1d7d2..1e562427 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -1510,7 +1510,7 @@ bus_connections_expect_reply (BusConnections *connections, if (dbus_message_get_no_reply (reply_to_this)) return TRUE; /* we won't allow a reply, since client doesn't care for one. */ - reply_serial = dbus_message_get_reply_serial (reply_to_this); + reply_serial = dbus_message_get_serial (reply_to_this); link = _dbus_list_get_first_link (&connections->pending_replies->items); while (link != NULL) @@ -1651,13 +1651,8 @@ bus_connections_check_reply (BusConnections *connections, if (link == NULL) { - _dbus_verbose ("No pending reply expected, disallowing this reply\n"); - - dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, - "%s message sent with reply serial %u, but no such reply was requested (or it has timed out already)\n", - dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_METHOD_RETURN ? - "method return" : "error", - reply_serial); + _dbus_verbose ("No pending reply expected\n"); + return FALSE; } @@ -1807,6 +1802,9 @@ bus_transaction_send_from_driver (BusTransaction *transaction, if (!dbus_message_set_sender (message, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS)) return FALSE; + /* bus driver never wants a reply */ + dbus_message_set_no_reply (message, TRUE); + /* If security policy doesn't allow the message, we silently * eat it; the driver doesn't care about getting a reply. */ |