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.
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
Created attachment 353978 [details] system-config-printer-get-devices patch
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?
Hi, authoritative for the D-Bus API is Vincent Untz. The new function is not accepted by him yet. I'll ask him. Marek
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?
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
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?
> 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().
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.
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
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
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.
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
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
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
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.