From b3bd48edfc1aab0a9dc64bfa4c380d845d218e73 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 25 Apr 2003 23:50:34 +0000 Subject: 2003-04-25 Havoc Pennington test suite is slightly hosed at the moment, will fix soon * bus/connection.c (bus_connections_expire_incomplete): fix to properly disable the timeout when required (bus_connection_set_name): check whether we can remove incomplete connections timeout after we complete each connection. * dbus/dbus-mainloop.c (check_timeout): fix this up a bit, probably still broken. * bus/services.c (bus_registry_acquire_service): implement max number of services owned, and honor allow/deny rules on which services a connection can own. * bus/connection.c (bus_connection_get_policy): report errors here * bus/activation.c: implement limit on number of pending activations --- bus/bus.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'bus/bus.c') diff --git a/bus/bus.c b/bus/bus.c index 7bb4bf99..dc0cb560 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -825,6 +825,18 @@ bus_context_get_max_connections_per_user (BusContext *context) return context->limits.max_connections_per_user; } +int +bus_context_get_max_pending_activations (BusContext *context) +{ + return context->limits.max_pending_activations; +} + +int +bus_context_get_max_services_per_connection (BusContext *context) +{ + return context->limits.max_services_per_connection; +} + dbus_bool_t bus_context_check_security_policy (BusContext *context, DBusConnection *sender, @@ -840,7 +852,13 @@ bus_context_check_security_policy (BusContext *context, if (sender != NULL) { _dbus_assert (dbus_connection_get_is_authenticated (sender)); - sender_policy = bus_connection_get_policy (sender); + sender_policy = bus_connection_get_policy (sender, error); + if (sender_policy == NULL) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + return FALSE; + } + return FALSE; } else sender_policy = NULL; @@ -848,12 +866,18 @@ bus_context_check_security_policy (BusContext *context, if (recipient != NULL) { _dbus_assert (dbus_connection_get_is_authenticated (recipient)); - recipient_policy = bus_connection_get_policy (recipient); + recipient_policy = bus_connection_get_policy (recipient, error); + if (recipient_policy == NULL) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + return FALSE; + } + return FALSE; } else recipient_policy = NULL; - if (sender_policy && + if (sender && !bus_client_policy_check_can_send (sender_policy, context->registry, recipient, message)) @@ -869,7 +893,7 @@ bus_context_check_security_policy (BusContext *context, return FALSE; } - if (recipient_policy && + if (recipient && !bus_client_policy_check_can_receive (recipient_policy, context->registry, sender, message)) -- cgit