FYI: testparm misses "lm announce" error

Steve Litt slitt at troubleshooters.com
Wed Dec 1 17:52:52 GMT 1999


Steve,

This is true of all P_ENUM type parameters. The loading process
(lp_do_parameter() in loadparm.c) silently ignores parameters set to a
value outside the enumeration. By the time do_global_checks() runs,
parm_table[] is set to the default. 

I think the easiest thing for you to do is put a debug statement in
loadparm.c's lp_do_parameter(), in the ||||case P_ENUM|||| part where it
loops thru the possible values. If it finds no matching values, write to
debug at level 3. When you run testparm while smbd is at debug level 3, you
should see it in your log. You can include the following right after the
for loop:

             if(i != 10000)               /*slitt*/
                DEBUG(3,("Error loading parameter %s=%s\n", /*slitt*/
                   parm_table[parmnum].label, pszParmValue)); /*slitt*/

Obviously you must additionally set i to 10000 if the if statement inside
the for loop succeeds. I actually tried this and it worked. You can run

testparm | grep -i "Error loading"

to see any P_ENUM s with erroneous values. 


I think if you try to have testparm itself check for this, you'd have to
add a section that scans the file itself, rather than the services and
parm_table[]. Unless there's something I'm overlooking...

Steve Litt



At 03:03 AM 12/02/1999 +1100, Steve Snyder wrote:
>I thought the developers of Samba would want to know that the testparm
>(v2.0.6) utility does not catch a misconfiguration of the "lm
>announce" parameter.
>
>I've mistakenly had this setting in my smb.conf for over a year:
>
>        lm announce = 30
>
>This error is a result of my confusing the "lm announce" and "lm 
>interval" parameters.  The actual valid values for "lm announce" are 
>only "true", "false", and "auto".
>
>I usually run testparm after any config change, yet this error has 
>never been detected.  It seems that my error is silently ignored. 
>This is what testparm says about my LanManager-related params:
>
>        lm announce = Auto
>        lm interval = 60
>
>As you can see, the default (correct) values are used without
>complaint.
>
>FYI.
>
>
>
>*** Steve Snyder ***
>
>



More information about the samba mailing list