Bug 506513 - Needs action for CUPS-Get-Devices IPP operation
Summary: Needs action for CUPS-Get-Devices IPP operation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cups-pk-helper
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Marek Kašík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 516713
TreeView+ depends on / blocked
 
Reported: 2009-06-17 15:30 UTC by Tim Waugh
Modified: 2009-08-25 22:14 UTC (History)
1 user (show)

Fixed In Version: 0.0.4-3.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-25 22:14:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
system-config-printer-get-devices patch (3.17 KB, patch)
2009-07-16 12:59 UTC, Marek Kašík
no flags Details | Diff

Description Tim Waugh 2009-06-17 15:30:58 UTC
The default policy in CUPS 1.4 has changed slightly from 1.3 in that the CUPS-Get-Devices operation now requires authentication.

We need an org.opensuse.cupspkhelper.mechanism.get-devices action (or something similar) for cups-pk-helper to handle the PolicyKit policy for this.

Comment 1 Marek Kašík 2009-07-16 12:58:30 UTC
Hi,

I added new action "DevicesGet" and policy "devices-get" to cups-pk-helper. It is committed and built for F-11 and rawhide now. I'll attach patch for system-config-printer.

Marek

Comment 2 Marek Kašík 2009-07-16 12:59:42 UTC
Created attachment 353978 [details]
system-config-printer-get-devices patch

Comment 3 Tim Waugh 2009-07-16 14:33:43 UTC
Great, thanks.  Actually I'm going to try changing it to be a bit more robust by making the cupspk method keep to the pycups interface, i.e. returning a dict of strings rather than cupshelpers.Device objects.

By the way, who is authoritative for that D-Bus API -- is it Vincent Untz?  Is the new function accepted upstream?

Comment 4 Marek Kašík 2009-07-16 14:48:48 UTC
Hi,

authoritative for the D-Bus API is Vincent Untz. The new function is not accepted by him yet. I'll ask him.

Marek

Comment 5 Tim Waugh 2009-07-16 15:54:14 UTC
Hmm, I'm seeing failures using the patch (without modification).  It seems to work the first time I click 'New', but then if I cancel and click 'New' again I get this on stdout/stderr:

PolicyKit call to DevicesGet did not work: PolicyKit communication issue

and it falls back to the IPP authentication.  Digging into it, it seems to be because the pk_function() call gets this exception:

org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)

Is there some way of avoiding that?

Comment 6 Marek Kašík 2009-07-17 13:55:00 UTC
I can not reproduce the problem. Did you tested it on Fedora 11? Was DBus restarted (which means restart of computer) after installation of the new cups-pk-helper?
I ran into similar problem when I was writing cupspk.py. It raised when user waited too long before entering password (30 seconds). I "fixed" it by setting timeout in Obtain Authorization to 2^31/1000.

Marek

Comment 7 Tim Waugh 2009-07-31 12:59:29 UTC
I'll test it some more.

By the way, this looks like it might be a separate (unrelated) bug fix -- is that right?

@@ -719,8 +766,8 @@ class Connection:
         settings = {}
         if result != None:
             for i in result.keys():
-                if type(i) == 'dbus.String':
-                    settings[i.encode()] = result[i].encode()
+                if type(i) == dbus.String:
+                    settings[str(i)] = str(result[i])
                 else:
                     settings[i] = result[i]
 

Any word from Vincent yet about whether DevicesGet is accepted into the interface?

Comment 8 Marek Kašík 2009-08-03 09:15:47 UTC
> By the way, this looks like it might be a separate (unrelated) bug fix -- is
> that right?

I noticed this during creating of the patch, so I changed it also.

> Any word from Vincent yet about whether DevicesGet is accepted into the
> interface?

I wrote to Vincent, he sent me his comments. I modified the patch and sent it back, but he didn't respond yet.

Comments were about missing parameters in DevicesGet (timeout, exclude_schemes and include_schemes -- I added them) and handling of older versions of CUPS which don't have cupsGetDevices().

Comment 9 Tim Waugh 2009-08-10 21:27:26 UTC
This is working well in rawhide.  Let's make sure it gets into Fedora 11 as well.  I'll handle the system-config-printer update.

Comment 10 Fedora Update System 2009-08-11 11:54:05 UTC
cups-pk-helper-0.0.4-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cups-pk-helper-0.0.4-2.fc11

Comment 11 Marek Kašík 2009-08-11 11:59:17 UTC
Since we didn't catch alpha freeze of rawhide with the modified patch, I won't add the timeout, exclude_schemes and include_schemes parameters into F11 and rawhide now. I'll add it later when it will be committed upstream.

Marek

Comment 12 Tim Waugh 2009-08-11 12:12:06 UTC
I have seen how awkward it can be to have several different versions of a D-Bus interface "in the wild"...

In this case I suppose system-config-printer will act as though cups-pk-helper is not available for the DevicesGet call if the signature does not match.  In that case it seems harmless enough.

Comment 13 Fedora Update System 2009-08-11 22:37:44 UTC
cups-pk-helper-0.0.4-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups-pk-helper'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8489

Comment 14 Fedora Update System 2009-08-13 14:15:29 UTC
cups-pk-helper-0.0.4-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cups-pk-helper-0.0.4-3.fc11

Comment 15 Fedora Update System 2009-08-15 08:19:43 UTC
cups-pk-helper-0.0.4-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups-pk-helper'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8587

Comment 16 Fedora Update System 2009-08-25 22:14:44 UTC
cups-pk-helper-0.0.4-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.