From 0fcca973dc17b32b98a5bf507c3111c36c8ffd32 Mon Sep 17 00:00:00 2001 From: mkasik Date: Aug 18 2009 14:23:25 +0000 Subject: - Check result of polkit_authority_check_authorization_sync() for NULL. --- diff --git a/cups-pk-helper.spec b/cups-pk-helper.spec index 73ae799..7b0a261 100644 --- a/cups-pk-helper.spec +++ b/cups-pk-helper.spec @@ -1,6 +1,6 @@ Name: cups-pk-helper Version: 0.0.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A helper that makes system-config-printer use PolicyKit Group: System Environment/Base @@ -10,6 +10,7 @@ Source0: http://www.vuntz.net/download/cups-pk-helper/cups-pk-helper-%{ve Patch0: polkit-1.patch Patch1: get_devices.patch +Patch2: polkit_result.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -41,6 +42,7 @@ interfaces available under control of PolicyKit. %patch0 -p1 -b .polkit-1 %patch1 -p1 -b .get-devices +%patch2 -p1 -b .polkit-result %build # Patch0 modifies configure.ac @@ -70,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Aug 18 2009 Marek Kasik - 0.0.4-6 +- Check result of polkit_authority_check_authorization_sync() for NULL. + * Thu Aug 13 2009 Marek Kasik - 0.0.4-5 - Add parameters to DevicesGet method. diff --git a/polkit_result.patch b/polkit_result.patch new file mode 100644 index 0000000..901b22c --- /dev/null +++ b/polkit_result.patch @@ -0,0 +1,123 @@ +--- cups-pk-helper-0.0.4/src/cups-pk-helper-mechanism.c.polkit-result 2009-08-17 14:55:52.000000000 +0200 ++++ cups-pk-helper-0.0.4/src/cups-pk-helper-mechanism.c 2009-08-17 14:55:52.000000000 +0200 +@@ -278,7 +278,7 @@ _check_polkit_for_action_internal (CphMe + NULL); + g_object_unref (pk_caller); + +- if (!polkit_authorization_result_get_is_authorized (pk_result)) { ++ if (pk_result == NULL || !polkit_authorization_result_get_is_authorized (pk_result)) { + g_set_error (error, + CPH_MECHANISM_ERROR, + CPH_MECHANISM_ERROR_NOT_PRIVILEGED, +--- cups-pk-helper-0.0.4/src/org.opensuse.cupspkhelper.mechanism.policy.in.polkit-result 2009-08-17 14:55:52.000000000 +0200 ++++ cups-pk-helper-0.0.4/src/org.opensuse.cupspkhelper.mechanism.policy.in 2009-08-17 14:55:52.000000000 +0200 +@@ -12,8 +12,8 @@ + operation: if some authorization is required, then the PolicyKit helper + will fallback on printer-X-edit. --> + +- <_description>Set a printer as default printer +- <_message>Privileges are required to set a printer, or a class, as default printer. ++ Set a printer as default printer ++ Privileges are required to set a printer, or a class, as default printer. + + no + auth_admin_keep +@@ -24,8 +24,8 @@ + operation: if some authorization is required, then the PolicyKit helper + will fallback on printer-X-edit. --> + +- <_description>Enable/Disable a printer +- <_message>Privileges are required to enable/disable a printer, or a class. ++ Enable/Disable a printer ++ Privileges are required to enable/disable a printer, or a class. + + no + auth_admin_keep +@@ -33,8 +33,8 @@ + + + +- <_description>Add/Remove/Edit a local printer +- <_message>Privileges are required to add/remove/edit a local printer. ++ Add/Remove/Edit a local printer ++ Privileges are required to add/remove/edit a local printer. + + no + auth_admin_keep +@@ -42,8 +42,8 @@ + + + +- <_description>Add/Remove/Edit a remote printer +- <_message>Privileges are required to add/remove/edit a remote printer. ++ Add/Remove/Edit a remote printer ++ Privileges are required to add/remove/edit a remote printer. + + no + auth_admin_keep +@@ -51,8 +51,8 @@ + + + +- <_description>Add/Remove/Edit a class +- <_message>Privileges are required to add/remove/edit a class. ++ Add/Remove/Edit a class ++ Privileges are required to add/remove/edit a class. + + no + auth_admin_keep +@@ -60,8 +60,8 @@ + + + +- <_description>Get/Set server settings +- <_message>Privileges are required to get/set server settings. ++ Get/Set server settings ++ Privileges are required to get/set server settings. + + no + auth_admin_keep +@@ -69,8 +69,8 @@ + + + +- <_description>Restart/Cancel/Edit a job +- <_message>Privileges are required to restart/cancel/edit a job. ++ Restart/Cancel/Edit a job ++ Privileges are required to restart/cancel/edit a job. + + no + yes +@@ -78,8 +78,8 @@ + + + +- <_description>Restart/Cancel/Edit a job owned by another user +- <_message>Privileges are required to restart/cancel/edit a job owned by another user. ++ Restart/Cancel/Edit a job owned by another user ++ Privileges are required to restart/cancel/edit a job owned by another user. + + no + auth_admin_keep +@@ -87,8 +87,8 @@ + + + +- <_description>Get devices +- <_message>Privileges are required to get devices. ++ Get devices ++ Privileges are required to get devices. + + no + auth_admin_keep +@@ -97,8 +97,8 @@ + + + +- <_description>Add/Remove/Edit a printer +- <_message>Privileges are required to add/remove/edit a printer. ++ Add/Remove/Edit a printer ++ Privileges are required to add/remove/edit a printer. + + no + auth_admin_keep