Bug 86473 - /usr/bin/smbprint incorrectly parses parameters
Summary: /usr/bin/smbprint incorrectly parses parameters
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: samba
Version: 7.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2003-03-23 12:07 UTC by Jan Ceuleers
Modified: 2014-08-31 23:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-04-08 15:46:02 UTC

Attachments (Terms of Use)
smbprint file, with my proposed change made in line 49 (2.24 KB, text/plain)
2003-03-23 12:19 UTC, Jan Ceuleers
no flags Details

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):
Linux version 2.4.18-27.7.x (bhcompile@stripples.devel.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.

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