[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: back-config, includes
Hallvard B Furuseth wrote:
Pierangelo Masarati writes:
Howard Chu wrote:
You're welcome to suggest something else. There's no reason that the
character used in the filesystem needs to be the same as the one in
the DIT, but it would be a bad idea to make the DIT representation vary.
One quick approach is to allow custom replacement of chars from DIT to
FS and forth. One could freely remap "=", "{", "}". and any other
offending char (something like autoconf rewriting all FS-specific chars
to "_", but reversible).
Sounds nice. And actually I would suggest "" and "-" as default
instead of "{" and "}".
For just the filesystem, or both filesystem and DIT? I would prefer that
FS and DIT are at least similar if not identical; dropping a character
in the FS and not in the DIT would be confusing. Also I chose to use two
balanced characters to make it unambiguous when the ordering component
is present, and allow the component to be absent in many cases.
Though I'm not sure why schema files need that much ordering
functionality, if this is part of the automatically maintained ordering
you mentioned elsewhere. The maintainer has to specify ordering of
schema files anyway, the server can't reorder them.
True for schema files that are present at server start time. Schema
added at runtime needs to be added in order, and that order needs to be
preserved for the next server restart. The automatic numbering upon
LDAPadd means you don't have to fuss with the numbering at that time.
Would it be enough to simply have the maintainer name the schema files
10-core.ldif
15-cosine.ldif
etc and let back-config sort the files in a directory and read them in
the sort order? Probably with a sort algorithm which sorts 5-x.ldif as
less than 10-x.ldif. Or one could declare that the numbers are to
be considered the decimals after a "0.":-)
0.5 is still greater than 0.10 so that doesn't help...
Anyway, back-ldif does sort the fs directory content and read in sorted
order. But you still need the numeric component, in one form or another.
Somewhere along the line I'll have to get a spec written for the
X-ORDERED schema extension I'm working with here. I've already described
the automatic numbering which is the primary feature, but here's a
rundown...
For single-valued attributes used as an RDN, adding the extension
"X-ORDERED 'SIBLINGS'" to the attribute definition means to maintain the
numeric index based on sibling entries with the same RDN attribute.
(Note that cn=include and cn=module are implemented with an ordering
behavior right now even though there's nothing in the schema to reflect
this. We need a couple new attribute definitions for them to make things
consistent.)
For multi-valued attributes, adding the extension "X-ORDERED 'VALUES'"
means to maintain the numeric index for all of the values of the
attribute. Regardless of the order in which values are stored in the
underlying database, the values will be sorted by their index values
before being returned to a client. Also, the numeric index may be used
instead of/in addition to the value in modify ops. (And maybe filter
assertions? Might be useful for valueReturn...) Otherwise, if the
numeric index is absent from the assertion value, it is ignored in
comparisons.
So if we have this entry
dn: olcDatabase={1}bdb,cn=config
olcDatabase: {1}bdb
objectClass: bdbConfig
olcSuffix: {0}dc=example,dc=com
olcSuffix: {1}o=example.com
We can perform these Modify operations:
dn: olcDatabase={1}bdb,cn=config
changetype: modify
delete: olcSuffix
olcSuffix: {0}
-
(Delete the first suffix, regardless of its value. All other values are
bumped up one position.)
delete: olcSuffix
olcSuffix: dc=example,dc=com
-
(Delete the suffix that matches the value, regardless of its index)
delete: olcSuffix
olcSuffix: {0}dc=example,dc=com
-
(Both index and value must match...)
add: olcSuffix
olcSuffix: o=example.org
-
(Add the new value, appended to the end)
add: olcSuffix
olcSuffix: {0}o=example.org
-
(Add the new value as value #0. All other values are bumped down one
position.)
The Suffix example is pretty trivial; ACL editing is where this really
makes a difference between usability and sheer torture...
--
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
http://www.symas.com http://highlandsun.com/hyc
Symas: Premier OpenSource Development and Support