From bac347e1cd5b2f6cfaad558b7376d142592bd400 Mon Sep 17 00:00:00 2001 From: mkasik Date: Jan 26 2009 13:24:30 +0000 Subject: - Add handling of file:/ protocol - Change order of checked policies so the PolicyKit asks only for "printer-enable" policy when enabling/disabling a printer - Change order of checked policies so the PolicyKit asks only for "printer-set-default" policy when setting default printer --- diff --git a/cups-pk-helper.spec b/cups-pk-helper.spec index 4c625e1..6217582 100644 --- a/cups-pk-helper.spec +++ b/cups-pk-helper.spec @@ -1,6 +1,6 @@ Name: cups-pk-helper Version: 0.0.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A helper that makes system-config-printer use PolicyKit Group: System Environment/Base @@ -9,6 +9,7 @@ URL: http://www.vuntz.net/download/cups-pk-helper/ Source0: http://www.vuntz.net/download/cups-pk-helper/cups-pk-helper-%{version}.tar.bz2 Patch0: dependencies.patch +Patch1: pk_order.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -32,6 +33,7 @@ interfaces available under control of PolicyKit. %setup -q %patch0 -p0 -b .dependencies +%patch1 -p0 -b .pk-order %build %configure @@ -58,6 +60,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jan 26 2009 Marek Kasik 0.0.3-2 +- Add handling of file:/ protocol +- Change order of checked policies so the PolicyKit asks only for + "printer-enable" policy when enabling/disabling a printer +- Change order of checked policies so the PolicyKit asks only for + "printer-set-default" policy when setting default printer * Tue Jan 13 2009 Marek Kasik 0.0.3-1 - Initial spec file. diff --git a/pk_order.patch b/pk_order.patch new file mode 100644 index 0000000..c7ec596 --- /dev/null +++ b/pk_order.patch @@ -0,0 +1,65 @@ +--- src/cups.c 2008-11-21 07:04:28.000000000 +0100 ++++ src/cups.c 2009-01-23 16:28:07.000000000 +0100 +@@ -1606,6 +1606,7 @@ cph_cups_is_printer_uri_local (const cha + g_str_has_prefix (lower_uri, "beh:") || + g_str_has_prefix (lower_uri, "scsi:") || + g_str_has_prefix (lower_uri, "serial:") || ++ g_str_has_prefix (lower_uri, "file:") || + g_str_has_prefix (lower_uri, "pipe:")) { + g_free (lower_uri); + return TRUE; +--- src/cups-pk-helper-mechanism.c 2008-11-21 07:28:20.000000000 +0100 ++++ src/cups-pk-helper-mechanism.c 2009-01-26 13:54:44.000000000 +0100 +@@ -901,21 +901,18 @@ cph_mechanism_printer_set_default (CphMe + DBusGMethodInvocation *context) + { + gboolean ret; +- const char *last_action; ++ const char *action; + + reset_killtimer (mechanism); + +- last_action = _cph_mechanism_get_action_for_name (mechanism, name); ++ action = _cph_mechanism_get_action_for_name (mechanism, name); + if (!_check_polkit_for_action_v (mechanism, context, + "printeraddremove", +- /* this is not the last check because +- * it's likely most useful to the user +- * to give "printer-X-edit" powers */ +- "printer-default", + /* quite important, since it's + * automatically called after adding a + * printer */ +- last_action, ++ action, ++ "printer-set-default", + NULL)) + return FALSE; + +@@ -932,21 +929,19 @@ cph_mechanism_printer_set_enabled (CphMe + DBusGMethodInvocation *context) + { + gboolean ret; +- const char *last_action; ++ const char *action; + + reset_killtimer (mechanism); + +- last_action = _cph_mechanism_get_action_for_name (mechanism, name); ++ action = _cph_mechanism_get_action_for_name (mechanism, name); ++ + if (!_check_polkit_for_action_v (mechanism, context, + "printeraddremove", +- /* this is not the last check because +- * it's likely most useful to the user +- * to give "printer-X-edit" powers */ +- "printer-enable", + /* quite important, since it's + * automatically called after adding a + * printer */ +- last_action, ++ action, ++ "printer-enable", + NULL)) + return FALSE; +