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

Re: empty strings



Joeri van Ruth wrote:
> 
> It seems that LDAP does not allow empty strings as
> attribute values.  Why is this?  Isn't the empty string
> a perfectly fine string?

Yep, but it is not a value. An empty string means ``this attribute has
no value'' and is equivalent to ``this attribute does not exist''.
Someone who has an empty ``givenname'' probably has no givenname [*].
Setting this to empty string would not help you - other than, maybe,
tell the difference between ``has no givenname'' or ``we don't know the
givenname''.

LDAP does not distinguish between these two situations, and RFC2251
says:

4.6 Modify operation
[...]
replace: replace all existing values of the given attribute with the new
values listed, creating the attribute if it did not already exist.  A
replace with no value will delete the entire attribute if it exists, and
is ignored if the attribute does not exist.

As you see: it is by design :-)

Verder leidt dat LDAP maar tot niets. Neem toch een hobby! ;-)

V.
[*] I agree that there are better examples than ``givenname'' for
something not to have ;-)
-- 
Valentijn Sessink - valentyn@nospam.openoffice.nl
-
Open Office - Linux for the desktop - www.openoffice.nl