[patch] Add user and group to activation helper

Havoc Pennington hp at redhat.com
Mon Jun 18 07:53:08 PDT 2007


Hi,

Richard Hughes wrote:
> +  /* user is not _required_ unless we are using system activation */
> +  if (!bus_desktop_file_get_string (desktop_file,
> +                                    DBUS_SERVICE_SECTION,
> +                                    DBUS_SERVICE_USER,
> +                                    &user, &tmp_error))
> +    {
> +      if (dbus_error_is_set (&tmp_error))

Unless bus_desktop_file_get_string() is messed up, it should be OK here 
to _DBUS_ASSERT_ERROR_IS_SET(&tmp_error) instead of checking it. i.e. 
the return of FALSE is supposed to reliably indicate whether error is set.

It should also be OK to _DBUS_ASSERT_ERROR_IS_CLEAR() if the return was 
TRUE.

(not 100% sure on those assertion macro names, but they exist with some 
name)

> +  /* group is not _required_ unless we are using system activation */
> +  if (!bus_desktop_file_get_string (desktop_file,
> +                                    DBUS_SERVICE_SECTION,
> +                                    DBUS_SERVICE_GROUP,
> +                                    &group, &tmp_error))
> +    {
> +      if (dbus_error_is_set (&tmp_error))

Same deal

Patch looks good otherwise.

Havoc



More information about the dbus mailing list