summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-08-18 15:46:59 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-08-18 15:46:59 +0000
commit7cd52919443f190fa1601a3d1bac5c8ce8d9ecc1 (patch)
treea64ecefa2f5115e67097d1b51aaebec9bad86237 /bus
parent711c065e5965cdf7a5869ecc3c3d43fb0dede34d (diff)
Patch provided by Ralf Habacker (ralf dot habacker at freenet dot de)
* dbus/dbus-sysdeps.c, dbus/dbus-threads.c, dbus/dbus-internals.h: Add two more global locks for use on windows platforms. These are unused on non-windows platforms but are not ifdefed out to avoid potential bugs (i.e. the few bytes lost does not warrent the extra maintanence and complexity that having seperate sets of locks would cause)
Diffstat (limited to 'bus')
-rw-r--r--bus/services.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/bus/services.c b/bus/services.c
index bb7e77f4..918f19d9 100644
--- a/bus/services.c
+++ b/bus/services.c
@@ -417,6 +417,18 @@ bus_registry_acquire_service (BusRegistry *registry,
goto out;
}
+ if (_dbus_string_equal_c_str (service_name, DBUS_SERVICE_DBUS))
+ {
+ dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
+ "Connection \"%s\" is not allowed to own the service \"%s\"because "
+ "it is reserved for D-Bus' use only",
+ bus_connection_is_active (connection) ?
+ bus_connection_get_name (connection) :
+ "(inactive)",
+ DBUS_SERVICE_DBUS);
+ goto out;
+ }
+
policy = bus_connection_get_policy (connection);
_dbus_assert (policy != NULL);
@@ -445,7 +457,7 @@ bus_registry_acquire_service (BusRegistry *registry,
_dbus_string_get_const_data (service_name));
goto out;
}
-
+
if (!bus_client_policy_check_can_own (policy, connection,
service_name))
{
@@ -623,6 +635,19 @@ bus_registry_release_service (BusRegistry *registry,
goto out;
}
+ if (_dbus_string_equal_c_str (service_name, DBUS_SERVICE_DBUS))
+ {
+ /* Not allowed; the base service name cannot be created or released */
+ dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
+ "Cannot release the %s service because it is owned by the bus",
+ DBUS_SERVICE_DBUS);
+
+ _dbus_verbose ("Attempt to release service name \"%s\"",
+ DBUS_SERVICE_DBUS);
+
+ goto out;
+ }
+
service = bus_registry_lookup (registry, service_name);
if (service == NULL)