After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 566522 - Can't print to smb printers requiring authorisation
Can't print to smb printers requiring authorisation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-04 16:37 UTC by Milan Bouchet-Valat
Modified: 2009-09-24 13:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
a patch adding support for 'auth-info' attribute (29.88 KB, patch)
2009-09-16 12:58 UTC, Marek Kašík
accepted-commit_after_freeze Details | Review
modified patch adding support for 'auth-info' attribute (30.30 KB, patch)
2009-09-24 08:28 UTC, Marek Kašík
none Details | Review

Description Milan Bouchet-Valat 2009-01-04 16:37:36 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.
Comment 1 Matthias Clasen 2009-01-05 02:27:48 UTC
We already have a bug open for handling of authentication

*** This bug has been marked as a duplicate of 384940 ***
Comment 2 Marek Kašík 2009-09-16 12:50:40 UTC
Reopening because the bug #384940 doesn't fix authentization of printers against Samba server.

Marek
Comment 3 Marek Kašík 2009-09-16 12:58:08 UTC
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
Comment 4 Matthias Clasen 2009-09-21 15:45:13 UTC
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.
Comment 5 Marek Kašík 2009-09-24 08:28:12 UTC
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
Comment 6 Matthias Clasen 2009-09-24 12:55:07 UTC
+  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.
Comment 7 Marek Kašík 2009-09-24 13:40:28 UTC
> 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