Skip to Content.
Sympa Menu

grouper-dev - handling quoted relative ldap dns ?

Subject: Grouper Developers Forum

List archive

handling quoted relative ldap dns ?


Chronological Thread 
  • From: Tom Zeller <>
  • To: Grouper Dev <>
  • Subject: handling quoted relative ldap dns ?
  • Date: Mon, 9 Nov 2009 13:51:36 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=x+QvgEcfr/QQYZVC/qOpLhoI4kETGbjNv1I6W0BgPEXi00K31WKDm+NZy+oSnq9L5k m3k+nD2vxFD7e3Fdnn0iaSopZi8MptOqSAszicJwPeo1Sum/a7vUFSZcQh61dDDoiBTL rPDfVgsUag3BUfCmyqSk+un04RHdqhGDgfZTI=

Hi folks,

Ldappc needs to construct a Name from a String dn, and I'm looking for
a better way to handled quoted relative names.

For example, I've observed that Active Directory will return

"CN=Quoted/Name",DC=edu

if a dn component contains the JNDI forward slash (/) character.

An InvalidNameException is thrown if construct a Name using LdapName :

Name name = new javax.naming.ldap.LdapName(dn).

javax.naming.InvalidNameException: Invalid name: "cn=Quoted/Name",DC=edu
at javax.naming.ldap.Rfc2253Parser.parseAttrType(Rfc2253Parser.java:130)
at javax.naming.ldap.Rfc2253Parser.doParse(Rfc2253Parser.java:83)
at javax.naming.ldap.Rfc2253Parser.parseDn(Rfc2253Parser.java:45)
at javax.naming.ldap.LdapName.parse(LdapName.java:772)
at javax.naming.ldap.LdapName.<init>(LdapName.java:108)

If I construct a Name via :

Name name = new javax.naming.CompositeName().add(dn)

then the quotes are escaped and the resultant dn is

"\"CN=Quoted/Name\",DC=edu"

which is incorrect.

Previously, ldappc removed starting and ending quotes from a dn
component. I've written a search result handler suitable for vt-ldap
to reproduce this behavior which deployers can toggle.

I'm surprised that I'm having to spend time figuring out ldap and jndi
metacharacters (well not that surprised), and I assume there's some
solution I'm just not familiar with.

Thanks,
TomZ



Archive powered by MHonArc 2.6.16.

Top of Page