Thursday, July 28, 2011

Windows printing via samba is broken in Lion [updated]

I just discovered that SMB-printing (Windows Printing via SAMBA) is broken in Lion. It seems like there are some kind of authentication bug between CUPS and SMB, but there is a workaround!

1. Add the printer as you always have done (DeviceURI: smb://server.company.com/printerqueue)
2. Connect to an available share on the print server
3. Print and type your credentials when asked

You must repeat step 2 each time you have logged out or restarted your computer.

Update

Another solution seems to involve editing printers.conf.
1. Stop cupsd (sudo launchctl stop org.cups.cupsd)
2. Edit the entry "AuthInfoRequired" so it says "username,password" instead of "negotiate" in /etc/cups/printers.conf
3. Start cupsd (sudo launchctl start org.cups.cupsd)

If you add a printer via the Print settings pane - Advanced, it will set up the printer with "negotiate", but if you set up the printer via the cups web interface (http://localhost:631) it will add the printer with "username,password".

I have an open bugreport on this so Apple knows about it.

Update 2
Above did not work... My hopes are now on Apple and their engineers...

3 comments:

Stylle said...

smb://FEUPsig.fe.up.pt;jruao:AefqaJ@printsrv.fe.up.pt/Geral_Cor_A4


You can add a printer using cups and it will be ok, just follow this instructions:
1. Point Safari to http://localhost:631
2. Select top menu "Administration"
3. Select "Add Printer"
4. Authenticate if requested
5. Select "Windows printer via spoolss" and press "Continue"
6. Use the following sintaxe to add the printer "smb://DOMAIN;LOGIN:PASSWORD@SERVER/PRINTQUEUE" in the "Connection" field and press "Continue" (replace CAPITALS with your own configuration)
7. Introduce a name in the "Name" field, for example MyPrinter
8. Select your printer Manufacturer from the "Make" list and press "Continue"
8. Select your printer Model from the "Model" list and press "Add Printer"

Good Luck!

Marcus Jaensson Wahlstam said...

Does not work, at least not in our environment, gives exactly the same error (backend error). Plus, look in your printers.conf. Everything in clear text. Sure, it's owned by root, but I don't like that passwords are not encrypted.

Pierre-Yves Langlois said...

When I connect to the cups back-end via http://localhost:631, I can select my printer and print a test page. It will output this error:

canceled at Wed Aug 24 13:13:35 2011
"/usr/libexec/cups/backend/smb failed"

This file is different from snow so it seems that the new version from lion contains bugs.

Here is what I will try:
- chmod 777 /usr/libexec/cups/backend/smb and try a reprint
- if it doesn't work, I will try to replace the file (backup it before!) /usr/libexec/cups/backend/smb from the one available in snow (hope that there is no missing dep)
- finally if it doesn't work, I will try to find a way to downgrade cups from Lion to Snow.

I anybody found the solution to this problem, let us know! Thanks!