[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/servers/slapd schema_init.c

On Wed, Dec 05, 2001 at 08:07:05AM -0800, Kurt D. Zeilenga wrote:
> At 07:53 AM 2001-12-05, Pierangelo Masarati wrote:
> >1) what is the normalization function in the Syntax 
> >structure for? I guess we mean a different type of
> >normalization when we talk about "normalizing a dn",
> >because all the *Normalize functions in schema_init.c
> >do not care about uppercasing case-insensitive strings 
> >and so; they mostly care about trimming extra space.

If I remember correctly, they are normalizing the actual values
stored. You want to do for instance case folding for matching
and in DNs, but the actual values need to be preserved and return
as they were stored (except for white space etc. for some syntaxes).

> Well, traditionally, "normalizing a DN" meant calling
> dn_normalize().  This "normalized" the string representation
> of the DN so that compared using strcmp().
> In the new data model, dnNormalize puts the value in some
> normalized form suitable for matching functions it cooperates
> with, dnMatch in this case.

If we for the different syntaxes had functions that did full
normalization (folding etc.) those could be used for normalizing
the attribute values in the DN and also by some of the matching
code I guess. Some of the matching would be slower if normalization
were done in advance, but there are also cases where we do
normalization and matching combined, where one of the arguments is
the same over and over and it would help if the values were
normalized in advance (and cached).

Could dnMatch be done by calling matching routines for the
different syntaxes for each attribute value? Is it okay to always
do matching in the attribute values that the DN consists of, or
is it necessary to use the DN string representation of the values?

My main question is whether we can normalize the values in the DN
in the same way we normalize when doing matching. If we have a DN
say a_n=s(v_n), ... a_1=s(v_1), a_0=s(v_0) (let's forget about
multivalue RDNs now) and another a_n=w_n, ... a_1=w_1, a_0=w_0,
aren't they equal if and only if each v_i is equal (equality match
for the syntax of a_i) to w_i?

My apologies if what I'm saying is silly, it's based on my naive
understanding of these things. I really should check the code
and reread drafts but no time for such.