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

Re: dn and search on special caracters (+,;..)



Jehan PROCACCIA wrote:

> I have well understand that I must escape special caracters in dn as it
> was said previously in this list:
>
> "
> Andrew Williams wrote:
> >
> > "cn=whois+++ipServiceProtocol=tcp,ou=Services,dc=vsinj,dc=net"
> > ldap_add: Invalid DN syntax
> >         additional info: invalid DN
>
> + is a special character for defining multi-attribute RDNs. You have
> to escape it with \. See RFC2253:
> "
>
> but now that I have escaped them, the \ keeps appearing when I browse
> the entries, even when I run searchs:
>
> example, here's my original ldif:
>
> dn: cn=whois\+\+\+ipServiceProtocol=tcp,ou=Services,dc=int-evry,dc=fr
> objectClass: ipService
> objectClass: top
> ipServicePort: 63
> ipServiceProtocol: tcp
> cn: whois\+\+
> description: IP service 63 (whois\+\+)

This dn is wrong: it should read

dn: cn=whois\+\++ipServiceProtocol=tcp,ou=Services,dc=int-evry,dc=fr

that is, the '+' before ipServiceProtocol must not be escaped.
Moreover, while you need to escape '+' in dn, you don't
in attribute 'cn' (I think, at least); as a result you can search
it normally.
So your entry should be:

dn: cn=whois\+\++ipServiceProtocol=tcp,ou=Services,dc=int-evry,dc=fr
objectClass: ipService
objectClass: top
ipServicePort: 63
ipServiceProtocol: tcp
cn: whois++
description: IP service 63 (whois++)

Please correct me if I'm wrong.

Pierangelo.

--
Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 | mailto:masarati@aero.polimi.it
via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati