Bug 86473

Summary: /usr/bin/smbprint incorrectly parses parameters
Product: [Retired] Red Hat Linux Reporter: Jan Ceuleers <jan.ceuleers>
Component: sambaAssignee: Jay Fenlason <fenlason>
Status: CLOSED DEFERRED QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: jfeeney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-08 15:46:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
smbprint file, with my proposed change made in line 49 none

Description Jan Ceuleers 2003-03-23 12:07:44 UTC
Description of problem:
/usr/bin/smbprint derives the location of the spool directory from the last 
parameter passed to it (which is the acct file). It does this by means of \$$#, 
which works as long as $# expands to a single digit.
On my system however, smbprint is called by LPRng with 22 parameters. This 
causes the above to expand to $22, which expands to <whatever is in $2>2 (i.e. 
a digit 2 appended to the value of $2).
In order to avoid this braces are needed, as follows: \${$#}

Version-Release number of selected component (if applicable):
samba-2.2.7-2.7.2
LPRng-3.7.4-28.1
Linux version 2.4.18-27.7.x (bhcompile.redhat.com) (gcc version 
2.96 20000731 (Red Hat Linux 7.3 2.96-112)) #1 Fri Mar 14 05:51:48 EST 2003

Comment 1 Jan Ceuleers 2003-03-23 12:19:18 UTC
Created attachment 90699 [details]
smbprint file, with my proposed change made in line 49

Comment 2 Jay Fenlason 2003-04-08 15:46:02 UTC
Unfortunatly, I didn't remember this one in time for the latest errata.  It will
be in the next one, however.