What is lp_load_ex() in source3/param/loadparm.c?

Andrew Bartlett abartlet at samba.org
Fri Aug 20 06:46:24 MDT 2010


On Fri, 2010-08-20 at 11:22 +0200, Michael Adam wrote:
> Hi Andrew,
> 
> Andrew Bartlett wrote:
> > I've been looking over the source3/param code with a view to finishing a
> > port of lp_set_cmdline() (by tridge).  In doing that I noticed that
> > lp_load_ex() isn't called from outside loadparm.c, and could be made
> > static. 
> > 
> > However, it looks like it was meant to be, or it's a public API that I
> > can't find the public definition for.  Before I make any foolish
> > mistakes, I wonder if someone might happen to be able to fill me in on
> > the history here?
> 
> lp_load_ex() is the most flexible lp_load function.
> The need for greater flexibility was born with the creation
> of clustered samba and registry configuration.
> We have wrappers to call it with special parameters:
> 
> lp_load() - standard
> 
> lp_load_initial_only()
>    wrapper to only load the smb.conf file
>    without including registry config (globals):
>    This is called in daemon startup before messaging etc is set
>    up: if "clustering = yes", we need to connect to the ctdb
>    daemon before we can load the registry config...
> 
> lp_load_with_registry_shares()
>    the registry shares are not usually loaded at lp_load() time,
>    but on demand by the server smbd/services.c .
>    But for testparm, e.g. we want to load everything, hence
>    this wrapper.
> 
> Possibly lp_load_ex was called outside of loadparm.c once,
> but now that we have these wrappers, it is not any more.
> 
> So I have just pushed a patch to master that makes it static.
> Thanks for being that careful!

Thanks for checking that over, and for the explaination.  Now I'm just
wondering what the first_time_only parameter of init_globals() is really
for.  It seems to be an override, to say that despite the static, please
do re-init the globals. 

In the second of the patches I attach I wondered if this would clarify
things.  What do you think?

Also, as I have been reading over the code, I developed these patches to
help me understand what each caller wanted.  Could you have a look at
them for me?

I've also included the start of an implementation of lp_set_cmdline()
that I've been working on with tridge, in case it can get some comment. 

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-param-added-lp_set_cmdline.patch
Type: text/x-patch
Size: 6262 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-param-Clarify-parameter-name-on-init_globals.patch
Type: text/x-patch
Size: 1891 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s3-param-Simplify-lp_load_with_registry_shares.patch
Type: text/x-patch
Size: 3382 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-s3-param-Add-lp_load_-default-_config_for_client.patch
Type: text/x-patch
Size: 1860 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0011.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-s3-param-Change-lp_load-lp_load_default_config_for_c.patch
Type: text/x-patch
Size: 12420 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-s3-param-Convert-lp_load-to-lp_load_config_for_clien.patch
Type: text/x-patch
Size: 4796 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0013.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-s3-param-Two-more-conversions-to-lp_load_default_for.patch
Type: text/x-patch
Size: 1492 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0014.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-s3-pdbtest-Fix-command-name-of-pdbtest.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0015.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100820/b9663e41/attachment-0001.pgp>


More information about the samba-technical mailing list