Red Hat Bugzilla – Bug 66475
smb.conf param expansion: quotes are lost
Last modified: 2014-08-31 19:24:09 EDT
Using samba-2.2.4-3 from Red Hat Rawhide.
I had the following string in my smb.conf:
command = /usr/bin/lpr -r "-P%p" "%s"
Running at a high debug level, I see this as a result of a
[2002/06/05 14:40:45, 3]
Running the command `/usr/bin/lpr -r "-
"smbprn.000070.vRIntd' gave 2
As you can see, the trailing quote is getting
lost before the command is
I then checked the loading of the config file and I see that
the quote is
still there when the config file is parsed:
doing parameter print command =
/usr/bin/lpr -r "-P%p" "%s"
So far I haven't found where the quote is getting
Removing the quotes from %s allows the command to run. I had initially
thinking the client's filename was used there, but it now
appears that it's a "safe" temp name
that doesn't need quotes.
Seems to happen in 2.2.5, too.
It appears the actual bug is in the parsing of all string config values. I can
easily replicate the problem with the Comment field of any share. It only
occurs if the string ends in a " character, so an easy workaround is to use the
' character (if possible--shells treat "" strings different from '' ones).
If this isn't fixed in 2.2.8-pre1, I'm going to pass it upstream.