Bug 1166201 - gnome-keyring auth_info lookup sometimes uses a different printer uri and fails to find auth_info saved by GTK
Summary: gnome-keyring auth_info lookup sometimes uses a different printer uri and fai...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-20 14:59 UTC by Andre Heinecke
Modified: 2015-02-22 06:03 UTC (History)
3 users (show)

Fixed In Version: system-config-printer-1.5.5-2.fc21
Clone Of:
Environment:
Last Closed: 2015-02-22 06:03:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Update the job-printer-uri over cups in update_job (1.56 KB, application/mbox)
2014-11-20 14:59 UTC, Andre Heinecke
no flags Details

Description Andre Heinecke 2014-11-20 14:59:01 UTC
Created attachment 959405 [details]
Update the job-printer-uri over cups in update_job

Hi,

Now that GTK has the possibility to store printer auth info in gnome-keyring (
https://bugzilla.gnome.org/show_bug.cgi?id=674264 ) and system-config-printer identifies auth_info with the IPP URL (BUG 1089029) they should be compatible. System-config-printer should find credentials stored with GTK and GTK should find them from System config printer.

But in our tests with Fedora 21 where both those changes are active (in GTK3) we noticed that this is not really the case.

Some analysis shows that GTK and system-config-printer "sometimes" have a missmatch between what they think should be the IPP Url.

In my test GTK stores a password with:
uri: ipp://localhost:631/printers/Generic-PDFsmb

This is obtained by a call to:
 gtk_cups_request_ipp_get_string (dispatch->request,
                                  IPP_TAG_URI,
                                  "printer-uri");

The URI is also used to find existing auth_info.

Afaik this should correspond to the job-printer-uri in jobviever.py

In system-config-printer though when I dump the data on a job that should be automatically authenticated through the update job mechanism I see:

 job-printer-uri = ipp://fedora21/printers/Generic-PDFsmb  (fedora21) is the hostname.

The uri with localhost and port is nowhere in this data.
So system-config-printer does not find the auth info and when it saved
it is not found in GTK.

If I then explicitly click authenticate in the system-config-printer menu we go
down through on_job_authenticate_activate and there we get the uri:

 job-printer-uri = ipp://localhost:631/printers/Generic-PDFsmb

Similary if I close system-config-printer and restart it on the next automatic update job i also get:

 job-printer-uri = ipp://localhost:631/printers/Generic-PDFsmb

And everything is fine!

But this does not help when the first call used the other URI and an entry
with the URI using the hostname was created.

I've added a backtrace in the bad case and it turned out that the problematic
URI came through job_event. In monitor.py dumping the event shows that
the notify-printer-uri in the event is the "ipp://fedora21/printers/Generic-PDFsmb" and thus the wrong one. I did not find the correct URI in the event  and as this comes from the Cups connection I don't think that we can do much to get the correct URI there.

Please see attached patch. It updates the job-printer-uri together with the other job-attributes in update_job and is mostly a comment to explain why the job-printer-uri is requested again as a job attribute even if it was already set earlier. 


There is now still an issue that GTK does not use an entry created by
system-config-printer but this is likely a problem in GTK, I'm debugging it from
there.

Comment 2 Fedora Update System 2015-02-09 12:48:31 UTC
system-config-printer-1.5.5-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/FEDORA-2015-1876/system-config-printer-1.5.5-2.fc21

Comment 3 Fedora Update System 2015-02-22 06:03:02 UTC
system-config-printer-1.5.5-2.fc21 has been pushed to the Fedora 21 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.