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

Re: Default Pretty Form of DNs

At 03:55 AM 2001-12-25, Stig Venaas wrote:
>On Tue, Dec 25, 2001 at 09:12:06AM +0100, Pierangelo Masarati wrote:
>> > The 2.0 slapd(8) currently maintains each DN in two forms: user
>> > and normalized.  The HEAD slapd(8) currently maintains each
>> > DN in two forms: pretty and normalized.
>> > 
>> > User - is what the user (client) provided.
>> > Pretty - a value-preserved representation of the DN.
>> > Normalized - a value-modified representation of the DN.
>What I'm trying to say, is that the normalized form we use internally,
>need not be visible to humans/logs/terminals.

The normalized form is generally not visible to users (nor is
it generally logged).  The pretty form is.  In fact, the user
provided DN is not maintained by the server or otherwise used
by the server once the pretty form has been constructed.

>In theory only the user
>(client) provided (including what is in the database) DNs, and not the
>normalized ones, need be visible externally. But if we need to display
>any DNs (normalized or other), we can do necessary escaping at display
>time. By display I mean logging etc. not when returned to client.

The logging system is presently assumed to be UTF-8 aware (or,
minimally, UTF-8 neutral).

>I very much agree with replacing "\," with hex-pair to ease parsing,

Actually, it's replacing "\\" with "\5C" which is most
needed to ease parsing.  Replacing "\+" "\," and "\="
with "\2B" "\2C" and "\3D", respectively, are also ease
certain parsing.  For example, verifying a "pretty" DN
contains one RDN can be done with a simple
  (strchr( pretty, ',' ) == NULL)
and, likewise, a check that an RDN contains one AVA can
be done with
  (strchr( pretty, '+' ) == NULL)

>that should be done by pretty the way I understand it now. Externally
>I think it's better to use "\,", it's more readable IMO.

I assume by externally you refer to work which the client
might do.

To do this internally would require the server to either
maintain/generate a third form.  This would be expensive.