grepping smb-share parameter from source for Samba-MySQL config tool

Peter Samuelson peter at
Thu Jun 29 23:53:41 GMT 2000

[Stephan Lauffer <lauffer at>]
> By the time this little script takes the keys and values out from the
> samba source samba-2.0.7/source/param/loadparm.c

Seems to work at this end.  I get 111 parameters instead of 110, but
the last is a local mod....

I tend to distrust tools that work by scanning for known patterns of
source code without actually parsing the source itself.  You see this a
*lot* with tools custom-written for a specific source project (such as
Samba's script/mkproto.awk), but I think it's too fragile.

Instead, my approach would be to use `testparm -s /dev/null', which
does almost what you want except that it also prints global parameters.
Just comment out the line "print_globals(f)" from lp_dump() in
loadparm.c, and recompile testparm.  Alternatively have lp_dump()
insert a newline or other marker between the globals and the defaults.


More information about the samba-technical mailing list