adding smb printer difficult on large networks

Bug #58403 reported by Ryan Rawdon
64
Affects Status Importance Assigned to Milestone
gnome-cups-manager (Ubuntu)
Invalid
Medium
Ross Burton

Bug Description

Binary package hint: gnome-cups-manager

This is a major nuisance, and after having many people talk to me for help I've decided to report it as a bug, because this severely inhibits the ability to add an SMB printer on large networks (for example... our campus network)

When you go to the System --> Administration --> Printing window and click on the "New Printer" tool, all starts as normal. In this case, you click Network Printer and change it to SMB. As soon as you get to the next page, the wizard apparently begins scanning/probing the local network (perhaps just the subnet? I'm not sure) for SMB print servers.

This is where the trouble begins. As it finds servers requiring authentication, it pops up an obnoxious little window asking for a username and password. Depending on network traffic and server/workstation response times, this can pop up almost instantly after you click Cancel or hit escape, requiring you to close these tens or hundreds of authentication popups before you can successfully put in the information for the printer you [most likely] already know the server and name of.

Someone will probably suggest filing this under wishlist, but I strongly urge you to file it as a bug since it severely cripples network printing abilities on medium to large networks.

My suggestion is that this doesn't automatically scan, that a scan button needs to be clicked before it does so. There are many ubuntu users on our campus, and this bug is a nuisance (to say the least) for everyone.

Revision history for this message
Jason R. Rokeach (archigos) wrote :

I can confirm this.

Changed in gnome-cups-manager:
status: Unconfirmed → Confirmed
Changed in gnome-cups-manager:
assignee: nobody → ross
Revision history for this message
Eric Li (lie2) wrote :

Confirm. Sat there for three minutes mashing ESC...

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

When it scans, it should simply not pop up any authentication windows (I do so in printerdrake in Mandriva). If it cannot obtain info (list of available printer shares) from a server without any authentication, it should skip the server. It can still ask for authentication if the user chooses one printer share from the scan result to set up a queue for it. So scanning can be still used when listing of resources is allowed by anonymous users but not printing.

Or one only shows the server name (without printer share names) when a server needs authentication for listing of resources. Then the authentication is only popped up when the user chooses this server name as destination for his print queue. After that a list of the printing resources of this server could be shown, for the user choosing the real destination.

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

At the suggestion of Michael Vogt, I looked through the gnome bugzilla for this bug for about 15 minutes, to see if perhaps this is an upstream problem. I cannot find anything related, but I am also not familiar with the gnome bugtracker at all. If anyone more familiar with gnome territory would like to take a look around, please do. Just the same, if anyone else is running another distribution and can test this to check for this bug's presence, please do that.

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

This bug is still present in edgy. I upgraded gnome-cups-manager and its dependencies from the edgy repos and it still acts exactly the same.

  I'm having a hard time navigating the gnome bug tracker and locating anything relevant to this. I have not reported it as upstream because I haven't tested this on another distro.

If someone can please test this on another distro and help browse the gnome bugtracker for relevant info, please do.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

gnome-cups-manager is not maintained upstream any more, it is about to be replaced in Edgy+1. See

https://features.launchpad.net/distros/ubuntu/+spec/printerdrake

To improve the scan for SMB/Windows printers in printerdrake (or any other tool) please cut and paste the following long command line (1 line) into a terminal to execute it (Samba client must be installed):

for i in `export LC_ALL=C; nmblookup \* 2> /dev/null | cut -f 1 -d ' ' | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done

Please tell:

- Are all your printer shares (at least the ones which do not need authentication for being listed) shown?
- Are you asked for a password?
- How big is your network (# of computers, Samba/Windows servers, network printers)?
- How long does above-mentioned command need to finish?

Suggestions to improve the command are welcome.

Changed in gnome-cups-manager:
status: Confirmed → Needs Info
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

@Till Kamppeter
Please don't use nmblookup in your long command line because in my case it don't work at all to find Name of clients.
"findsmb" has to be used instead of nmblookup

In my case, simple windows98se clients sharing printers

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

So for you

for i in `export LC_ALL=C; findnmb 2> /dev/null | cut -f 1 -d ' ' | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done

works?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Sorry, s/findnmb/findsmb/:

for i in `export LC_ALL=C; findsmb 2> /dev/null | cut -f 1 -d ' ' | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done

Does this work for you? You really do not get asked for a password and machines who require a password already for listing there printers/shares get silently skipped?

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

I'll test that out once I get to campus in a couple of hours

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

@Till

i suggest :
for i in `export LC_ALL=C; findsmb 2> /dev/null | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tr -s " " | cut -f2 -d ' ' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done

result :
PATRICE
---------------
        HP 1120C A3 Printer

SATORI
---------------
        print$ Disk Printer Drivers

SECRETAIRE
---------------
        EPSON5700 Printer

Satori is the notebook where i execute command

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

Below is the output from running it on my home laptop. 192.168.0.1 and 192.168.0.10 are linux machines with samba installed, but no actual printers shared. The real test will be when I'm on campus.

--
192.168.0.1
---------------
        print$ Disk Printer Drivers
        lp Printer Generic dot-matrix printer entry

192.168.0.10
---------------
        print$ Disk Printer Drivers
        lp Printer Generic dot-matrix printer entry

192.168.0.115
---------------
        print$ Disk Printer Drivers

192.168.0.116
---------------
        hppsc1350 Printer hp psc 1300 series
        print$ Disk Printer Drivers

192.168.0.120
---------------
        print$ Disk Printer Drivers
        PSC-1310 Printer psc1310
        DeskJet-842C Printer Deskjet 842C

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

On campus I tried the last two command strings suggested. The output is posted below. I needed to break the second one because it stopped giving output after the first few lines

--- begin output

ryan@ryanlc1:~$ for i in `export LC_ALL=C; findsmb 2> /dev/null | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tr -s " " | cut -f2 -d ' ' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done
COLUMBIA
---------------

KSY
---------------

UNDERARMOUR
---------------
        print$ Disk Printer Drivers
        Printer Printer Microsoft Office Document Image Writer

unknown
---------------

ryan@ryanlc1:~$ for i in `export LC_ALL=C; findsmb 2> /dev/null | cut -f 1 -d ' ' | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done
10.254.254.253
---------------

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

@Till
your command line don't work for me because :
Patrice == 192.168.1.103

kagou@satori:~$ smbclient -N -L 192.168.1.103
session request to 192.168.1.103 failed (Called name not present)
session request to 192 failed (Called name not present)
session request to *SMBSERVER failed (Called name not present)

I had to replace IP by netbios name :
kagou@satori:~$ smbclient -N -L Patrice

        Sharename Type Comment
        --------- ---- -------
        C Disk
        D Disk
        PRINTER$ Disk
        HP 1120C A3 Printer
        GRAVEUR Disk
        LECTEUR CD Disk
        APIBAT Disk
        SLI Disk
        SISPRO Disk
        ECODIAL3 Disk
        ECOBAT Disk
        IPC$ IPC Remote Inter Process Communication

        Server Comment
        --------- -------

        Workgroup Master
        --------- -------

We do not have name server/samba server.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

So we should use a command line based on Netbios names and not on IPs, like this one

for i in `export LC_ALL=C; findsmb 2> /dev/null | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tr -s " " | cut -f2 -d ' ' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done

to reliably find all printer shares?

Have you servers who require a password to list their shares? If so, are these servers correctky skipped and is the search continued on the next server?

Changed in gnome-cups-manager:
importance: Undecided → Medium
Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

the command in the previous comment (for i in `export LC_ALL=C; findsmb 2> /dev/null | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tr -s " " | cut -f2 -d ' ' | uniq | sort`; do echo $i; echo ---------------; export LC_ALL=C; smbclient -N -L $i 2> /dev/null | grep Printer; echo; done
)

works. I tried it on the large network which caused these original complaints and it did successfully find smb print servers on my subnet without bugging me for passwords.

I think it should be tested by some people on smaller home/office networks so that we can make sure it detects what it should (because I don't know for sure that it found everything that it should have on here)

Hopefully this will be fixed soon, there are about 30 Ubuntu users on our campus that are constantly asking me about the status of this

Revision history for this message
Nikolaus Filus (nfilus) wrote :

The above command doesn't work for me. I have a small broadband router with an integrated print server:

Starting Nmap 4.10 ( http://www.insecure.org/nmap/ ) at 2007-02-01 17:22 CET
Interesting ports on 192.168.1.2:
Not shown: 1675 closed ports
PORT STATE SERVICE
23/tcp open telnet
80/tcp open http
139/tcp open netbios-ssn
515/tcp open printer
MAC Address: 00:40:01:51:CF:40 (Zyxel Communications)

root@mobile:~# smbclient -L //192.168.1.2
Password:
Domain=[wgnet] OS=[Unix] Server=[Samba 2.0.7]

        Sharename Type Comment
        --------- ---- -------
        HL730 Printer Printer
        LP2 Printer Printer
Domain=[wgnet] OS=[Unix] Server=[Samba 2.0.7]

        Server Comment
        --------- -------

        Workgroup Master
        --------- -------

findsmb doesn't work for me.

Revision history for this message
Jani Monoses (jani) wrote :

If system-config-printer replaces gnome-cups-manager in gutsy the fix should be done in that package

https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/127152

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Scanning for SMB-shared printers works now very well with system-config-printer. Many problems were solved there. See bug 127152.

If you are on Gutsy you should try the newest version (will appear in Gutsy after Tribe 5) from

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/system-config-printer/

Does this version of system-config-printer solve your problem?

Revision history for this message
Ryan Rawdon (flieslikeabrick) wrote :

The changes upstream to the printer management software in GNOME made this problem disappear starting in Gutsy and in Hardy as well. Marking it as invalid to close the matter.

Changed in gnome-cups-manager:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.