Variable substitution bug in Samba 1.9.18p10 ?
Andre Albsmeier
andre.albsmeier at mchp.siemens.de
Wed Sep 23 20:49:47 GMT 1998
While trying to debug the fact that printing works here
but the print queue isn't returned properly, I found the
following behaviour which might be a bug in Samba 1.9.18p10:
I have (among others) the following lines in smb.conf:
[printer1]
create mode = 0700
read only = yes
printable = yes
path = /var/spool/samba
printer name = %S
comment = Kyocera FS3600+
printer driver = Kyocera FS-3600+ (KPDL-2)
[printer2]
copy = printer1
comment = Laserjet 4M Plus
printer driver = HP LaserJet 4M Plus
Since my printcap printers have the same names (printer1 and
printer2) and I am lazy :-), I used the %S variable.
Printing works (using the lpr command) but the printer queue
shown on the Windows machines is always empty (using lpq).
By turning on the debugging I saw the follwing output in the logfile:
Running the command `lpr -r -s -P printer1 /var/spool/samba/mobifi.n23036' gave 0
Here, with the print command, everything works. But later we find
Running the command `lpq -PIPC$' gave 256
which fails of course since there is no printer IPC$.
For some reason, the substitution of %p (which turns out to become %S)
doesn't work when running lpq.
However, when using the following lines in smb.conf, everything works:
[printer1]
create mode = 0700
read only = yes
printable = yes
path = /var/spool/samba
printer name = printer1
comment = Kyocera FS3600+
printer driver = Kyocera FS-3600+ (KPDL-2)
[printer2]
copy = printer1
printer name = printer2
comment = Laserjet 4M Plus
printer driver = HP LaserJet 4M Plus
Here, the printer name was changed from %S to the real printer name.
What do you think?
-Andre
P.S.: Running on FreeBSD_2.2.7 but this shouldn't matter
More information about the samba
mailing list