Bug 702039 - Samba3x is not getting printer "location" attribute from Cups
Samba3x is not getting printer "location" attribute from Cups
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: samba3x (Show other bugs)
5.5
x86_64 Unspecified
high Severity high
: rc
: ---
Assigned To: Guenther Deschner
qe-baseos-daemons
:
Depends On:
Blocks: 709617
  Show dependency treegraph
 
Reported: 2011-05-04 11:46 EDT by Andrea Cavallari
Modified: 2012-09-24 09:29 EDT (History)
3 users (show)

See Also:
Fixed In Version: samba3x-3.5.4-0.77.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 709617 (view as bug list)
Environment:
Last Closed: 2011-07-21 03:29:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
location attribute is blank in windows side while browsing shared printers (47.42 KB, image/png)
2011-05-04 11:47 EDT, Andrea Cavallari
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Samba Project 8071 None None None Never

  None (edit)
Description Andrea Cavallari 2011-05-04 11:46:05 EDT
Description of problem:
The "Location" option is defined in cupsd.conf in order to allow users see a description about printer location while browsing printers as described in # man cuspd.conf:

Location text
            Specifies human-readable text describing the location of the printer.

Customer is sharing printers via Samba3x (latest version samba3x-3.5.4-0.70.el5_6.1) and browsing printers via Windows Explorer (in Windows XP SP2 and Windows 2003 clients).

The problem is that Cups web interface shows "Location" field correctly and also lpstat :

[root@sbclps15 ~]# 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:Imbetiba - Predio:Prédio 111 - Andar:3 - Dep/Ger:TIC/INFRA-TIC/TIC-BC/SITI - Sala:IL
	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:


But Samba3x can not obtain this info:

[root@sbclps15 ~]# rpcclient -Uascyyi localhost -c "getprinter 'ADNY'"
Enter ascyyi's password: 
	flags:[0x800000]
	name:[\\LOCALHOST\ADNY]
	description:[\\LOCALHOST\ADNY,HP Universal Printing PS (v5.1),]
	comment:[HP Color LaserJet 4700dn]

[root@sbclps15 ~]# rpcclient -Uascyyi 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]




Version-Release number of selected component (if applicable):
samba3x-3.5.4-0.70.el5_6.1

How reproducible:
Always

Steps to Reproduce:
1. Add printers in Cups
2. Fill "location" field
3. In windows client machine, browse the shared printer
4. The location field is not displayed anymore

  
Actual results:
Windows clients can not see the location of the printers. The organization has more than 1500 printers distributed in various regions and is important to know where the printer is (location: printer in directory, printer in finance room, etc) because users need to identify the printer where the job will be printed.

Expected results:
Samba obtain this info from Cups and allow windows clients accessing the printers to know the printer location.

Additional info:

Customer has another print server using samba 3.0.33-3.29.el5_6.2 and doing the same job, with the same Windows clients and the "Location" attribute is showed.

Perhaps this was intentional. See this thread:

http://lists.samba.org/archive/samba/2008-January/137292.html

"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."


The interesting bit is that the slow down occurred due to samba queries to cups for "comment" and "location" information. These fields may be left empty now per this comment:

http://lists.samba.org/archive/samba/2008-January/137306.html


For "comment" field, we can use rpcclient to set it:

# rpcclient localhost -U Administrator -c 'setprinter test1 "Test printer"'

But for "Location" field the only way is set it via windows. But customer has a lot of printers and would be hard to set it one by one via windows.

I'm not sure if it is considered a regression ou and RFE. 

In case of RFE, customer is fine to have the option to set "location" using  rpcclient command too (the same as for "comment" field).
Comment 1 Andrea Cavallari 2011-05-04 11:46:52 EDT
Also you can find file blank_location.png attached. 
It is a print screen from Windows Explorer. In this image you can see that Windows clients can see shared printers but "Location" attribute is empty.
Comment 2 Andrea Cavallari 2011-05-04 11:47:39 EDT
Created attachment 496829 [details]
location attribute is blank in windows side while browsing shared printers
Comment 3 Andrea Cavallari 2011-05-04 11:48:41 EDT
Justin also contributted in this case and check that:

Our code for 3.5.4 is supposed to pull this information, i'm not sure why it's not making it into ntprinters.tdb. From source3/printing/nt_printing.c:


#ifdef HAVE_CUPS
        if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) {
                /* Pull the location and comment strings from cups if we don't
                   already have one */
                if ( !strlen(info->location) || !strlen(info->comment) )
                        cups_pull_comment_location( info );
        }
#endif

Thanks,

Justin
Comment 4 Andrea Cavallari 2011-05-04 11:53:17 EDT
I've handled cases some time ago point to the slowness of cups printing due a
lots of printer attributes that need to be loaded. And with a large number of
printers the .tdbs gets enormous and evem have to increase tdb hash size to
storage all these information.

It makes sense reduce the number of attribute to avoid slowness and enormous
.tdbs.

But "location" field is the key to users decide (and know) where they should
print their jobs.

I've agreed with customer that at least the possibility to add it via command
line is enough (instead of make samba get it automatically again).
Comment 5 Andrea Cavallari 2011-05-04 11:55:45 EDT
If this case is considered an RFE, just let me know and I'll provide RFE template with all required info.
Comment 14 errata-xmlrpc 2011-07-21 03:29:52 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1007.html

Note You need to log in before you can comment on or make changes to this bug.