Bug 702039 - Samba3x is not getting printer "location" attribute from Cups
Summary: Samba3x is not getting printer "location" attribute from Cups
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: samba3x
Version: 5.5
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Guenther Deschner
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 709617
TreeView+ depends on / blocked
 
Reported: 2011-05-04 15:46 UTC by Andrea Cavallari
Modified: 2018-11-14 13:16 UTC (History)
3 users (show)

Fixed In Version: samba3x-3.5.4-0.77.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 709617 (view as bug list)
Environment:
Last Closed: 2011-07-21 07:29:52 UTC
Target Upstream Version:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1007 0 normal SHIPPED_LIVE samba3x bug fix update 2011-07-20 15:44:43 UTC
Samba Project 8071 0 None None None Never

Description Andrea Cavallari 2011-05-04 15:46:05 UTC
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 15:46:52 UTC
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 15:47:39 UTC
Created attachment 496829 [details]
location attribute is blank in windows side while browsing shared printers

Comment 3 Andrea Cavallari 2011-05-04 15:48:41 UTC
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 15:53:17 UTC
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 15:55:45 UTC
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 07:29:52 UTC
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.