rpms/gnome-panel/F-12 polkit-error.patch, NONE, 1.1 gnome-panel.spec, 1.387, 1.388

Matthias Clasen mclasen at fedoraproject.org
Wed Dec 16 04:07:40 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gnome-panel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3870

Modified Files:
	gnome-panel.spec 
Added Files:
	polkit-error.patch 
Log Message:
handle polkit errors in the clock applet


polkit-error.patch:
 gnome-clock-applet-mechanism.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

--- NEW FILE polkit-error.patch ---
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);
         }


Index: gnome-panel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-panel/F-12/gnome-panel.spec,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -p -r1.387 -r1.388
--- gnome-panel.spec	8 Dec 2009 20:00:24 -0000	1.387
+++ gnome-panel.spec	16 Dec 2009 04:07:40 -0000	1.388
@@ -22,7 +22,7 @@
 Summary: GNOME panel
 Name: gnome-panel
 Version: 2.28.0
-Release: 16%{?dist}
+Release: 17%{?dist}
 URL: http://www.gnome.org
 Source0: http://download.gnome.org/sources/gnome-panel/2.28/%{name}-%{version}.tar.bz2
 
@@ -133,6 +133,9 @@ Patch46: resolution-change.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=537798
 Patch47: fix-clock-crash.patch
 
+# https://bugzilla.gnome.org/show_bug.cgi?id=604678
+Patch48: polkit-error.patch
+
 Conflicts: gnome-power-manager < 2.15.3
 
 %description
@@ -186,6 +189,7 @@ Panel Applets using the libpanel-applet 
 %patch45 -p1 -b .icon-padding
 %patch46 -p1 -b .resolution-change
 %patch47 -p1 -b .fix-clock-crash
+%patch48 -p1 -b .polkit-error
 
 . %{SOURCE6}
 
@@ -393,6 +397,9 @@ fi
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Tue Dec 15 2009 Matthias Clasen <mclasen at redhat.com> 2.28.0-17
+- Handle errors returned from PolicyKit in the clock applet (#547624)
+
 * Tue Dec 08 2009 Ray Strode <rstrode at redhat.com> 2.28.0-16
 - Fix clock crash (bug 537798)
 




More information about the scm-commits mailing list