[patch] disallow requesting org.freedesktop.DBus
Robert McQueen
robert.mcqueen at collabora.co.uk
Thu Aug 17 14:32:34 PDT 2006
Looks good. Thanks for fixing my bug... I'd totally forgotten about that
one. :)
Regards,
Rob
John (J5) Palmieri wrote:
> Before this patch you could request org.freedesktop.DBus without an
> error being raised. You wouldn't actually own it but D-Bus would return
> PRIMARY_OWNER. This specifically errors out with a detailed error
> message if you try to request the name.
>
>
>
> ------------------------------------------------------------------------
>
> Index: bus/services.c
> ===================================================================
> RCS file: /cvs/dbus/dbus/bus/services.c,v
> retrieving revision 1.34
> diff -u -r1.34 services.c
> --- bus/services.c 14 Aug 2006 19:11:35 -0000 1.34
> +++ bus/services.c 17 Aug 2006 20:45:41 -0000
> @@ -445,7 +445,19 @@
> _dbus_string_get_const_data (service_name));
> goto out;
> }
> -
> +
> + if (_dbus_string_equal_c_str (service_name, DBUS_SERVICE_DBUS))
> + {
> + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
> + "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_string_get_const_data (service_name));
> + goto out;
> + }
> +
> if (!bus_client_policy_check_can_own (policy, connection,
> service_name))
> {
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
--
Robert McQueen
Director, Collabora Ltd.
More information about the dbus
mailing list