summaryrefslogtreecommitdiffstats
path: root/polkit-error.patch
blob: cfeaa027aaf84a05967736590b216e3937d44d04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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);
         }