+2006-08-18 John (J5) Palmieri <johnp@redhat.com>
+
+ 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)
+
+2006-08-18 John (J5) Palmieri <johnp@redhat.com>
+
+ * bus/services.c (bus_registry_acquire_service): Return an error
+ when an application tries to register the org.freedesktop.DBus Bus Name
+
+ * bus/services.c (bus_registry_release_service): Return an error
+ when an application tries to release the org.freedesktop.DBus Bus Name
+
2006-08-17 Alp Toker <alp@atoker.com>
* doc/dbus-specification.xml: Fix some minor typos.
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);
_dbus_string_get_const_data (service_name));
goto out;
}
-
+
if (!bus_client_policy_check_can_own (policy, connection,
service_name))
{
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)
_DBUS_DECLARE_GLOBAL_LOCK (system_users);
_DBUS_DECLARE_GLOBAL_LOCK (message_cache);
_DBUS_DECLARE_GLOBAL_LOCK (shared_connections);
-#define _DBUS_N_GLOBAL_LOCKS (11)
+_DBUS_DECLARE_GLOBAL_LOCK (win_fds);
+_DBUS_DECLARE_GLOBAL_LOCK (sid_atom_cache);
+#define _DBUS_N_GLOBAL_LOCKS (13)
dbus_bool_t _dbus_threads_init_debug (void);
#define socklen_t int
#endif
+_DBUS_DEFINE_GLOBAL_LOCK (win_fds);
+_DBUS_DEFINE_GLOBAL_LOCK (sid_atom_cache);
+
/**
* @addtogroup DBusInternalsUtils
* @{
DBusMutex **global_locks[] = {
#define LOCK_ADDR(name) (& _dbus_lock_##name)
+ LOCK_ADDR (win_fds),
+ LOCK_ADDR (sid_atom_cache),
LOCK_ADDR (list),
LOCK_ADDR (connection_slots),
LOCK_ADDR (pending_call_slots),