GNOME Bugzilla – Bug 566522
Can't print to smb printers requiring authorisation
Last modified: 2009-09-24 13:40:28 UTC
This is a bug that appears in Evince, GEdit and Firefox. Nothing is wrong when printing from OO.o or Okular. See the Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/evince/+bug/305030 The Debian one: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499759 And a blog with details: http://blog.avirtualhome.com/2008/11/21/cant-print-in-evince-gedit-claws-mail/ This was reported in Evince (bug 553196) first, but it seems to be in GTK. Please describe the problem: Via CUPS I have a printer defined which is on a Windows server. In the URI for the printer I have defined a user name and password in this format user:password@server The printer works when printing from OpenOffice, Adobe Acrobat and when making test pages from CUPS. But I can't print from evince: Dialog "Failed to print document. Can't prompt for authorization". Note that when printing from the other apps I mentioned, there is no authorisation prompt. Steps to reproduce: 1. Set up a smb printer using cups, which requires a user and password 2. Open a PDF into evince 3. Try to print it Actual results: Printing does not success due to the dialog box mentioned above. Expected results: The document should print. Does this happen every time? Yes.
We already have a bug open for handling of authentication *** This bug has been marked as a duplicate of 384940 ***
Reopening because the bug #384940 doesn't fix authentization of printers against Samba server. Marek
Created attachment 143273 [details] [review] a patch adding support for 'auth-info' attribute Hi, this patch adds support for handling of 'auth-info' attribute which is used by Samba for printing. It modifies current password dialog to be able to get informations requested in 'auth-info-required'. Marek
Looks good in a quick look. Considering that we're just a day away from 2.18.0, lets hold this until after the release, and put it in 2.18.1. We should test-drive it in rawhide, though. I'll do that when I build 2.18.0 for rawhide. Some detailed comments: + auth_info_required = g_new0 (gchar*, length + 1); + auth_info_required[0] = g_strdup ("hostname"); + auth_info_required[1] = g_strdup ("username"); + auth_info_required[2] = g_strdup ("password"); Does this mean that the hostname will now appear as an entry field in the dialog ? That doesn't seem right to me. Ah, I see that the hostname is filtered out by means of having a NULL display string, ok. + if (job_title != NULL && printer_name != NULL) + prompt = g_strdup_printf ( _("Authentication informations are required to print document '%s' on printer %s"), job_title, printer_name); This string needs some work. It should probably be shortened to "Authentication is required to print document '%s' on printer %s" and we should show a string even if we miss some of the strings, maybe "Authentication is required to print this document on printer %s" if the document title is missing, and "Authentication is required to print this document" if both are missing.
Created attachment 143878 [details] [review] modified patch adding support for 'auth-info' attribute This patch improves the "prompt" part. The original text was so long because I wanted to differentiate between classic CUPS authorization and samba (auth-info) authorization. Marek
+ printer_name = NULL; + + if (job_title != NULL) + { + if (printer_name != NULL) + prompt = g_strdup_printf ( _("Authentication is required to print document '%s' on printer %s"), job_title, printer_name); I assume the 'printer_name = NULL;' line is just leftover debugging here ? Can printer_name or job_title ever be NULL here, actually ? Other than that, looks ok to me.
> I assume the 'printer_name = NULL;' line is just leftover debugging here ? You are right. I'm sorry about that. > Can printer_name or job_title ever be NULL here, actually ? It is unlikely. Committed: Add support for 'auth-info' attribute to the CUPS backend Check for 'auth-info-required' attribute from printer attributes to find out whether an authentization of user is needed. Change password dialog of print backend to be able to require informations requested thru 'auth-info-required' (#566522). Marek