Why Samba3x is not getting printer "location" attribute from Cups in RHEL5.6?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5.6
  • samba3x-3.5.4-0.70.el5_6.1

Issue

  • Samba3x is not getting printer "location" or "comment" attribute atomatically from Cups anymore after migration from samba3.0 to samba3x (samba3x-3.5.4-0.70.el5_6.1) on RHEL 5.6. There is any way to fix it? Or a command line I can use to input this information in samba and have it showed to customers when they browse printer?

Resolution

As a workaround, please set the "comment" and "location" string of every printer from your Windows client in the printers and faxes section. When samba has both strings in its ntprinter.tdb database, it will no longer ask cups for them.

Or you can use rpcclient command with option -c setprinter to define a printer "comment" via command line. Example:

# rpcclient localhost -U Administrator -c 'setprinter teste1 "My test printer"'

However, it was considered a bug in samba3x-3.5.4-0.70.el5_6.1 due "location" field is the key to users decide (and know) where they should print their jobs and this info should be captured automatically.

So, to completely solve this problem update samba to version samba3x-3.5.4-0.77.el5 or later that contains a fix for this issue.

Root Cause

Query for location attribute was removed in samba3x-3.5.4-0.70.el5_6.1 in order to speed up samba communication with Cups. But as this change cause a lot of impact for users, it was included again in samba code in version samba3x-3.5.4-0.77.el5.

Diagnostic Steps

Run lpstat or rpcclient getprinter command to check printer attributes and information.

Result on RHEL5 runing samba3.0 is the location field showed ok:

[root@test ~]# lpstat -l -p ADNY
printer ADNY is idle.  enabled since Tue 29 Mar 2011 11:31:02 AM BRT
    Form mounted:
    Content types: any
    Printer types: unknown
    Description: HP Color LaserJet 4700dn
    Alerts: none
    Location: Sede:Sao Paulo/Brazil - Room: 111 - Dept:3 - Support
    Connection: direct
    On fault: no alert
    After fault: continue
    Users allowed:
        (all)
    Forms allowed:
        (none)
    Banner required
    Charset sets:
        (none)
    Default pitch:
    Default page size:
    Default port settings:

Result on RHEL 5 runing samba3x is that location field is empty:

[root@test ~]# rpcclient -Uuser localhost -c "getprinter 'ADNY' 2"
Enter ascyyi's password: 
    servername:[\\LOCALHOST]
    printername:[\\LOCALHOST\ADNY]
    sharename:[ADNY]
    portname:[Samba Printer Port]
    drivername:[HP Universal Printing PS (v5.1)]
    comment:[HP Color LaserJet 4700dn]
    location:[]
    sepfile:[]
    printprocessor:[winprint]
    datatype:[RAW]
    parameters:[]
    attributes:[0x3048]
    priority:[0x1]
    defaultpriority:[0x1]
    starttime:[0x0]
    untiltime:[0x0]
    status:[0x0]
    cjobs:[0x0]
    averageppm:[0x0]

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments