You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@directory.apache.org by ernie kovak <er...@hotmail.com> on 2013/06/11 23:51:05 UTC

Utility for DN character escaping?

Is there a class that will handle character escaping for DNs? Something like what the FilterEncoder class does for search filters?

See also: http://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx

Thanks!
Ernie
 		 	   		  

Re: Utility for DN character escaping?

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 6/11/13 11:51 PM, ernie kovak a écrit :
> Is there a class that will handle character escaping for DNs? Something like what the FilterEncoder class does for search filters?

No. The pb is that it does not make a lot of sense to escape anything in
a DN : how does such a method knows what to escape ? For instance, the
',', '=', ';'... chars are likely to be used as perfectly valid chars in
a DN, so how do we decide that they should be eascaped ?

Let me give you an example : we have a cn which value is
'acme;ou=paris'. In a DN, that would be "cn=acme;ou=paris, dc=acme,
dc=com". This is a valid Dn, which will be parsed as the list of 4 RDN :
cn=acme
ou=paris
dc=acme
dc=com

which is really different from the real (or expected) list of RDNs :
cn=acme;ou=paris
dc=acme
dc=com


So magically, a method would *know* that it should escape the ';' and
the '=' in "acme;ou=paris" ?

It's really doubtful.

Thoughts ?


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com