Can not print on an SMB shared printer after password change

Bug #735297 reported by Theodotos Andreou on 2011-03-15
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
system-config-printer (Ubuntu)
Tim Waugh

Bug Description

Binary package hint: cups

I print to a number of SMB shared printers in a 2003 Active Directory domain. My password is changed from time to time as a policy in our organisation. When this happens I get prompted to enter the new password but I can no longer connect to the using the new password. The previous password was saved using the "Saved forever" option

The only workaround I found is to delete the printer and recreate it. I had this problem several times in the past and so are the rest of my ubuntu users. Is there a workaround for that. Can someone confirm this bug?

I tried to sniff the packets from my PC to the Print Server but wireshark showed nothing! This means that the problem is actually on my side. I can connect to other domain services like file shares using the same credentials. I am using the DOMAIN\username format to connect.

The relevant cups error logs are here in case you want to have a look:

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: cups 1.4.4-6ubuntu2.3
ProcVersionSignature: Ubuntu 2.6.35-27.48-generic-pae
Uname: Linux 2.6.35-27-generic-pae i686
NonfreeKernelModules: fglrx
Architecture: i386
Date: Tue Mar 15 08:25:04 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
 device for Deskjet-F4200-series: hp:/usb/Deskjet_F4200_series?serial=CN84A3D1SN052D
 device for FOLLOWME: smb://
 device for hp-LaserJet-2300-series: dnssd://hp%20LaserJet%202300%20series%20(0001E6A8204B)._printer._tcp.local/
 device for PDF: cups-pdf:/
 device for SRB02MF001: smb://
MachineType: LENOVO 2767WB7
Papersize: letter
 Socket 0:
   no product info available
 Socket 0:
   no card
 SRB02MF001: NRG MP C2500 PXL
 Deskjet-F4200-series: HP Deskjet f4200 Series hpijs, 3.10.6
 PDF: Generic CUPS-PDF Printer
 hp-LaserJet-2300-series: HP LaserJet 2300 Postscript (recommended)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.35-27-generic-pae root=UUID=5440d147-6520-49af-a1fd-76b8ec027c80 ro splash quiet splash
 PATH=(custom, user)
SourcePackage: cups 10/17/2008
dmi.bios.vendor: LENOVO
dmi.bios.version: 7UET49WW (1.19 ) 2767WB7
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr7UET49WW(1.19):bd10/17/2008:svnLENOVO:pn2767WB7:pvrThinkPadT400:rvnLENOVO:rn2767WB7:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable: 2767WB7
dmi.product.version: ThinkPad T400
dmi.sys.vendor: LENOVO

Theodotos Andreou (theodotos) wrote :
Till Kamppeter (till-kamppeter) wrote :

Can you attach the file /etc/cups/printers.conf? If you do not want to post a file containing your password, then edit the file at first. If you find your old password somewhere in your file, replace it by "OLDPASSWORD", if you find your new password, replace it by "NEWPASSWORD". Thanks.

Changed in cups (Ubuntu):
status: New → Incomplete
Changed in system-config-printer (Ubuntu):
status: New → Incomplete
Till Kamppeter (till-kamppeter) wrote :

Tim, Jiri, is there any password caching in the system-config-printer applet? Or is the password cached by CUPS? Where does it get cached?

Theodotos Andreou (theodotos) wrote :

Here it is:

The real password is removed but the one displayed previously was the correct one. The SMB printers of interest are "FOLLOWME" and "SRB02MF001"

Thanks for looking into this!

Theodotos Andreou (theodotos) wrote :

Actually the SRB02MF001 was deleted and recreated and works fine. I kept the problematic FOLLOWME configuration so we get the chance to test it.

Till Kamppeter (till-kamppeter) wrote :

I have checked your printers.conf and the non-working FollowMe has the line

AuthInfoRequired username,password\

which the working SRB02MF001 does not have. Stop the CUPS daemon, then edit your /etc/cups/printers.conf removing the mentioned line from the entry of FollowMe. Then start CUPS again and see whether the problem goes away. Seems that older CUPS versions needed (or at least inserted) this line and newer ones have problems with it. If the removal helps, we will look into removing this line during the package installation/update of CUPS.

Theodotos Andreou (theodotos) wrote :

OK I now see what is happening. I commented out the "AuthInfoRequired" line but I still get the problem. The issue is that the follow me line still has the old password and it will not update it automatically after prompted even when I click the "Remember Password" option.

That explains why it works when deleted. All entries are erased and recreated when the new printer is created. But for whatever reason it cannot update the password to an existing printer.

I think this is a serious bug that could affect the use of Ubuntu in enterprise environments.

Till Kamppeter (till-kamppeter) wrote :

Tim, Jiri, can there be something wrong with the password prompting facility of the system-config-printer applet? Does it perhaps need some updated way to tell CUPS abot the password change? How does the entered password get into printers.conf?

Tim Waugh (twaugh) wrote :

So, here's what happened:

CUPS receives job to print, fires up smb backend to print it
smb backend communicates with server, server requires password
We don't have one, so smb backend stops, telling cupsd why
cupsd marks the job as requiring authentication
At this point, CUPS knows that "username,password" is required for jobs to this queue so it adds that attribute to the printer configuration.
s-c-printer-applet sees the job has stopped and requires auth, so displays an authentication dialog
Once received from user, the applet uses IPP-Authenticate-Job to restart the job

Now, for future jobs, CUPS will actually refuse to queue the job unless it is accompanies by "username,password"-type auth-info. It already knows, from past experience, that a username and password will be required.

So now it is up to the application that talks to CUPS to provide the username and password.

Conveniently, s-c-printer-applet stored the user's credentials (if they chose to) in the GNOME keyring, so you can look it up there. Alternatively, the application has to make its own arrangements e.g. presenting another auth dialog at that point.

Tim, would it not be much more user-frendly, if one does the following:

If a print job fails because it needs a password, the applet askes for user/password and gives the possibility to save the credentials. If the user opts for saving, it sends the job and if the credentials are correct it adds "<user>:<password>@" to the printer's URI, if not, it simply sends the job.

As many print dialogs of applications do not support asking for passwords, it should be assured that the applet also asks for any future jobs which fail due to a missing or wrong user/password in the URI. The applet should perhaps even remove the "username,password" from the printer configuration, so that CUPS gets the job and it can ask for credentials again for the case that the user did not save the credentials.


Tim Waugh (twaugh) wrote :

No -- this would permanently break the queue when the password is changed.

Print dialogs that want to talk to CUPS must support authentication.

Tim, so this means that all is working as designed? Should the bug be closed?

Tim Waugh (twaugh) wrote :

"When this happens I get prompted to enter the new password but I can no longer connect to the using the new password."

This is the crux of the problem from what I can see. Need to find out which prompt that is, and why it isn't correctly supplying the right credentials (or why they fail).

Changed in system-config-printer (Ubuntu):
assignee: nobody → Tim Waugh (twaugh)
Launchpad Janitor (janitor) wrote :

[Expired for cups (Ubuntu) because there has been no activity for 60 days.]

Changed in cups (Ubuntu):
status: Incomplete → Expired
Ronan Mooney (roomey) wrote :

This is the dialogue box which causes the error (see attachment "Print dialog bug.pdf" .

FYI workaround is:
* Open the printer configuration and right click on the already added printer and select "Properties":
* Go to the Device URI section and click “Change…”
On the top menu item (what your printer is called) select the radio button to “set authentication details now” and type in your username/password

Ronan Mooney (roomey) wrote :

[12:08] ######:~# xprop
                window state: Normal
                icon window: 0xca3dd00
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x5200001
XdndAware(ATOM) = BITMAP
_NET_WM_OPAQUE_REGION(CARDINAL) = 7, 0, 571, 7, 0, 7, 585, 187
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x5201d98
WM_CLIENT_LEADER(WINDOW): window id # 0x5200001
                program specified location: 0, 0
                program specified minimum size: 585 by 194
                program specified maximum size: 585 by 194
                program specified base size: 0 by 0
                window gravity: NorthWest
WM_CLASS(STRING) = "system-config-printer", ""
WM_ICON_NAME(STRING) = "Authentication"
_NET_WM_ICON_NAME(UTF8_STRING) = "Authentication"
WM_NAME(STRING) = "Authentication"
_NET_WM_NAME(UTF8_STRING) = "Authentication"

Andreas Gnau (rondom) on 2018-06-21
Changed in system-config-printer (Ubuntu):
status: Incomplete → Confirmed
teramind (soeren-w) wrote :

@ronan Where can I find this printer configuration?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers