Red Hat Bugzilla – Bug 143038
cups does not call smb backend with username/password
Last modified: 2014-08-31 19:27:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
This is the configuration from /etc/cups/printers.conf
Location HP Deskjet 3650
JobSheets none none
When directed to print, cups calls /usr/lib/cups/backend/smb with
smb://WORKGROUP/wuzzy/deskjet, which means it is explicitly removing
the username:password. Obviously this fails since we are not
authenticated with the SMB share we're trying to print to. Manually
calling /usr/lib/cups/backend/smb with the proper URI works, and my
own temporary fix was a bash script:
~# cat /usr/lib/cups/backend/smb
smb://username:password@WORKGROUP/wuzzy/deskjet $2 $3 \"$4\" $5 \"$6\"
Obviously this is not portable, cups needs to be fixed to pass on the
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Add printer to be accessed via SMB
2. Attempt to print
3. View resulting NT_ACCESS_DENIED error message.
Actual Results: Repeated access denied errors.
Expected Results: Printout
Confirmed with 1.1.22-6.
On closer inspection everything looks fine as far as cupsd is concerned: the
DEVICE_URI environment variable is correctly set in smbspool's environment,
complete with username and password.
Any problems beyond that belong to the samba package.
This is a regression in cups. The version in FC3 supplies smbspool with a
correct printer URI in both argv and DEVICE_URI. The version in rawhide
supplies a damaged URI in argv. The smbspool man page says "smbspool tries
to get the URI from argv. If argv contains the name of the program then
it looks in the DEVICE_URI environment variable.", so smbspool is working as
CUPS needs to either supply a correct URI in argv or only supply one in
DEVICE_URI. Supplying a damaged URI in argv is Just Wrong.
DEVICE_URI is authoritative; argv is informative. See the CUPS Software
Programmers Manual, 3 "Writing Filters" [referenced by 5 "Writing Backends"]:
Command Line Arguments
printer - The name of the printer queue (normally this is the name of the
program being run)
DEVICE_URI - The output device URI
Since smbspool intends to be compatible with the CUPS interface for backends, it
needs to make sure that it uses DEVICE_URI when set.
In samba-3.0.8 and later smbspool prefers DEVICE_URI over argv (current
rawhide has 3.0.10-2, FC2 and FC3 and RHEL3 also ship post-3.0.8 versions of
Samba). However, the Samba documentation was not. I've opened an upstream
doc bug to get this corrected.
What version of Samba are you running?
Looks like this is fixed in rawhide.