configuration, ldap and NetInfo
Robert Frank
frank at ifi.unibas.ch
Fri Apr 17 13:29:08 GMT 1998
> > 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.
Little missunderstanding here, If you put the defaults into the 'current'
value and have the boolean 'default' set to true, then that is the default
value. Once a parameter is read (or set otherwise), the boolean is set to
false. Viola, you know its no longer the default value.
> 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.
The boolean will allow exactly the same, but it occupies only one storage
location (a string uses more).
> > 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!
It can: show only the defaults: list only values with 'default' = yes
show only the values read: list only values with 'default' = no
show all values: list all values.
> > 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
Do we need a new *type* or would a flag suffice (allowing ints to be lists
too)? That this doesn't require any changes in the conf syntax is per se
correct, but my other examples of parsing show that we would be in trouble
under certain (common!) cases.
-Robert
-------------------------------------
Institut fuer Informatik tel +41 (0)61 321 99 67
Universitaet Basel fax. +41 (0)61 321 99 15
Robert Frank
Mittlere Strasse 142 rfc822: frank at ifi.unibas.ch (NeXT,MIME mail ok)
CH-4056 Basel (remove any no_spam_ from my return address)
Switzerland
More information about the samba-technical
mailing list