[RFC] smbcquotas: correct init order

Andreas Schneider asn at samba.org
Wed Oct 5 06:42:46 UTC 2016


On Tuesday, 4 October 2016 23:06:32 CEST Uri Simchoni wrote:
> Hi,
> 
> The attached patch (not even a git commit yet) changes the order of
> loadparm initialization and command line processing in smbcquotas.

Hi Uri,

the position you moved the lp_load_global() seems to be correct, however 
load_interfaces() must be called after we loaded the smb.conf! It uses values 
from smb.conf.

> Andreas brought to my attention that something in the free-disk+quota
> tests (samba3.blackbox.dfree_quota) isn't reading the self-test env
> smb.conf, but is instead reading the default smb.conf for the binary.
> This seems to fix it for this test.
> 
> I'd like some input whether this is sufficient for fixing the issue. I
> see that some test scripts are handed the location of smb.conf, but it
> seems to be unnecessary because the selftest env is setting
> SMB_CONF_PATH env var which directly affects smb.conf location if the
> command line is processed prior to loading smb.conf. What I'm asking
> really is whether we should consider the place of smb.conf when writing
> black-box tests, or is it taken care of automatically via SMB_CONF_PATH.

I think it is sufficient. We should rely on SMB_CONF_PATH unless we need to 
use a different configuration for the test.

> 
> Also please comment if there are things to watch out for with respect to
> order of lp_ and popt processing.

The config should be loaded after popt processing. There are some init 
functions which need to be called after we load the smb.conf like 
load_interfaces() or init_names().


Cheers,


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loadparm.patch
Type: text/x-patch
Size: 4328 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161005/1294f2ab/loadparm.bin>


More information about the samba-technical mailing list