configuration, ldap and NetInfo

Andrew Tridgell tridge at samba.anu.edu.au
Fri Apr 17 12:40:04 GMT 1998


> I was a bit anoyed to see some non-samba related code (SWAT) in the
> sources. I think that samba and configuration managers must be completely
> decoupled (in regards to the source code).

1) As Jeremy said, one reason is that it means SWAT and Samba are
   always in sync regarding parameter sets. Yes, I do plan on adding a
   switch to testparm to allow external progs to also get all the
   info, but this isn't good enough for SWAT ...

2) SWAT directly accesses the shared memory segment in Samba. It has
   to do this to allow it to manipulate the locked file and share
   info. I want SWAT to be able to force the breaking of oplocks
   etc. You can see some of this in SWAT already. No external tool can
   attach to the shared memory.

3) it allows SWAT to use *exactly* the same smb.conf parser as
   Samba. So there is no chance that the config tool and Samba diagree
   on what is in the file.

4) SWAT needs to link to the password changing code to allow for clean
   integration with domain password addition/deletion etc.

there are heaps of other reasons ... most of them based on future
stuff I want to add. It would be very tricky to do it all and not
integrate really tightly with the main code.
 
> Andrew, why add another field (union) for the defaults? A boolean
> specifying whether the value is a default or was loaded would suffice -
> no?

no, it wouldn't :-}

The union contains the default value, not the current value. If you
had a flag and used that to pick out the type of the current value
then where would you keep the default value? In a separate table? That
would be ugly. 

The union stores the default value after defaults are initialised. It
allows SWAT and testparm to print only those values that are different
from the default. That makes for small and readable config files. 

> In this way, you could add an option to testparm (e.g. -d, -n) which
> would output only the defaults, only the added values, or both.

so how would it work out what the "added values" are without that
union or something equivalent? It can't!
 
> If I properly understood the mechanism of the parser, then line 333 in
> params.c (which sets a NULL character in the buffer) will force users to
> add a space after the = sign. If they don't, then the first character of
> the value will be lost.

a quick test shows this not to be the case. 

> Why all of this? I want to parse value lists at launch time, not each time
> the list is used, because NetInfo will provide such a list by default.
> Currently, I have to reconstruct the list for samba when retrieving values
> from NetInfo. I guess ldap has similar facilities.

I think the right way to do this is to define a new string list type
in loadparm.c. loadparm has its own type system for just this sort of
purpose. We add a P_SLIST type and fill in the parsers etc. Should be
simple to do and doesn't require any smb.conf syntax changes.

Cheers, Andrew


More information about the samba-technical mailing list