[patch] Fixes for bug 3639, Comments on the same line as parameters in smb.conf are not diagnosed or honored

David Collier-Brown davec-b at rogers.com
Mon Aug 20 12:42:10 GMT 2007


    Er, I don't understand that...  it should strictly fix **erroneous**
code, causing failed operation to succeed, such as the path example in
Gerry Carter's note, below:

---
   Gerry Carter noted "Samba does not allow mixing of comment lines and
parameters. Be careful not to put comments on the same line as anything 
else, such as:
        path = /data # server's data partition
Errors such as this, where the parameter value is defined with a string, 
can be tricky to notice. The testparm program won’t complain.  The only
clues you’ll receive are that testparm reports the path parameter set to 

        /d # server's data partition,
and the failures that result when clients attempt to access the share."
---

   Therefor, if someone has a smb.conf line that says
	path = /data # server's data partition
then it will now work as the user intended, and connections
to that share will work.

   I'd suggest that writing
	any option = a value # some text
is in the case of all but one kind of value is strictly
an attempt to describe the option in some manner.
   There is one special case where one might wish to use a
# character, and that is in comments and server strings.
    If the user really wants to force the samba parser to accept
a # character as part of such a string, they can work around
the fix by quoting the #.  I illustrated this by testing with
an smb.conf which contained
        server string = "test version # 3"
which indeed causes it to pass through.

   Hmmn, It strikes me today that \# should also work...

--dave

Volker Lendecke wrote:
> On Sun, Aug 19, 2007 at 10:01:01AM -0400, David Collier-Brown wrote:
> 
>>  This is a fix for the long-standing bug which caused in-line comments
>>to be mistaken for parts of a parameter, which I'm fixing as a "Samba
>>janitor" task (;-))
>>  Both samba 3 and samba 4 patches are attached.
> 
> 
> I'm not sure I like this change. This will inevitably break
> existing configurations. I know that the current behaviour
> is not optimal, but it's there and I think it is about to
> stay.
> 
> Volker

-- 
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net           |                      -- Mark Twain
(416) 223-5943


More information about the samba-technical mailing list