bac347e1cd
- 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
66 lines
3.2 KiB
Diff
66 lines
3.2 KiB
Diff
--- 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;
|
|
|