diff -up gnome-panel-2.28.0/applets/clock/gnome-clock-applet-mechanism.c.polkit-error gnome-panel-2.28.0/applets/clock/gnome-clock-applet-mechanism.c --- gnome-panel-2.28.0/applets/clock/gnome-clock-applet-mechanism.c.polkit-error 2009-12-15 22:43:20.419177854 -0500 +++ gnome-panel-2.28.0/applets/clock/gnome-clock-applet-mechanism.c 2009-12-15 22:46:08.544926738 -0500 @@ -241,9 +241,16 @@ _check_polkit_for_action (GnomeClockAppl action, NULL, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, - NULL, NULL); + NULL, &error); g_object_unref (subject); + if (error) { + dbus_g_method_return_error (context, error); + g_error_free (error); + + return FALSE; + } + if (!polkit_authorization_result_get_is_authorized (result)) { error = g_error_new (GNOME_CLOCK_APPLET_MECHANISM_ERROR, GNOME_CLOCK_APPLET_MECHANISM_ERROR_NOT_PRIVILEGED, @@ -565,19 +572,28 @@ check_can_do (GnomeClockAppletMechanism const char *sender; PolkitSubject *subject; PolkitAuthorizationResult *result; + GError *error; /* Check that caller is privileged */ sender = dbus_g_method_get_sender (context); subject = polkit_system_bus_name_new (sender); + error = NULL; result = polkit_authority_check_authorization_sync (mechanism->priv->auth, subject, action, NULL, 0, - NULL, NULL); + NULL, + &error); g_object_unref (subject); + if (error) { + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + if (polkit_authorization_result_get_is_authorized (result)) { dbus_g_method_return (context, 2); }