summaryrefslogtreecommitdiffstats
path: root/bus/bus.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-25 23:50:34 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-25 23:50:34 +0000
commitb3bd48edfc1aab0a9dc64bfa4c380d845d218e73 (patch)
tree0ba9466c0b457769e9aa890906da532d875aac43 /bus/bus.c
parent4b87aa40dfba668f8622873f2ea420b098704e41 (diff)
2003-04-25 Havoc Pennington <hp@redhat.com>
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
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c32
1 files changed, 28 insertions, 4 deletions
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))