From e8d396efef695b9868b0112c4a6266c97678fa8a Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 27 Apr 2003 06:25:42 +0000 Subject: 2003-04-27 Havoc Pennington Unbreak my code... * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status): report correct status if we finish processing authentication inside this function. * bus/activation.c (try_send_activation_failure): use bus_transaction_send_error_reply * bus/connection.c (bus_connection_get_groups): return an error explaining the problem * bus/bus.c (bus_context_check_security_policy): implement restriction here that inactive connections can only send the hello message. Also, allow bus driver to send anything to any recipient. * bus/connection.c (bus_connection_complete): create the BusClientPolicy here instead of on-demand. (bus_connection_get_policy): don't return an error * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL sender field in message being replied to * bus/bus.c (bus_context_check_security_policy): fix silly typo causing it to return FALSE always * bus/policy.c (bus_client_policy_check_can_send): fix bug where we checked sender rather than destination --- bus/driver.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'bus/driver.c') diff --git a/bus/driver.c b/bus/driver.c index 9839ff03..3c4847ba 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -298,9 +298,9 @@ bus_driver_handle_hello (DBusConnection *connection, goto out_0; } - if (!bus_connection_set_name (connection, &unique_name)) + if (!bus_connection_complete (connection, &unique_name, error)) { - BUS_SET_OOM (error); + _DBUS_ASSERT_ERROR_IS_SET (error); goto out_0; } @@ -627,15 +627,8 @@ bus_driver_handle_message (DBusConnection *connection, name = dbus_message_get_name (message); sender = dbus_message_get_sender (message); - if (sender == NULL && (strcmp (name, DBUS_MESSAGE_HELLO) != 0)) - { - dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, - "Client tried to send a message other than %s without being registered", - DBUS_MESSAGE_HELLO); - - dbus_connection_disconnect (connection); - return FALSE; - } + /* security checks should have kept this from getting here */ + _dbus_assert (sender != NULL || strcmp (name, DBUS_MESSAGE_HELLO) == 0); if (dbus_message_get_reply_serial (message) == 0) { -- cgit