[Date Prev][Date Next]
Re: attribute value *
Probst, Carsten writes:
> i have to create an objectclass with some attributes. one of them needs
> to be an attribute which should be able to store the value "*"
> (asterix). i defined the value as a string. would you expect any kind of
> problems to save "*" here and is there maybe a better datatype than
> string for this?
I don't know what you mean by the datatype "string". I wonder if you
are confusing LDAP syntaxes with datatypes in a program which uses LDAP,
An LDAP attribute is defined to have some specific LDAP syntax. There
is no "string" LDAP syntax, but if the attribute has the most commonly
used LDAP syntax, 22.214.171.124.4.1.14126.96.36.199.15 (Directory String), it
can store "*" just fine. So can IA5 String, but not Printable String.
> second question is: the cn to this kind of new defined object should
> also contain the "*" because of an requirement from the sw-development.
> is it possible to have an e.g. cn=86866-8-* ?
Sure. And you write it just like that in a DN.
OTOH, if you search for something which contains '*', e.g. the cn
"foo*bar", you must quote the "*" in the search filter:
'(cn=foo\2Abar)'. And since \ is an escape character in strings in many
programming languages, that filter must be written "(cn=foo\\2Abar)" in
e.g. a C program.