rwinch / spring-ldap

Apache License 2.0
0 stars 0 forks source link

LDAP-296: Quoted Names Not Parsed Correctly #77

Closed rwinch closed 8 years ago

rwinch commented 10 years ago

Original Reporter: tailwaggers Environment: Not Specified Version: 1.3.1 Migrated From: https://jira.spring.io//browse/LDAP-296 The DistinguishedName class incorrectly parses DNs that use the quotes around a value to handle special characters. According to the last paragraph in section 4 of RFC 2253: {quote} Implementations MUST allow a value to be surrounded by quote ('"' ASCII 34) characters, which are not part of the value. Inside the quoted value, the following characters can occur without any escaping:

               ",", "=", "+", "<", ">", "#" and ";"

{quote}

The following code: {code:java} String stringDn = "ou=\"Foo + Bar\",cn=some,cn=org"; DistinguishedName dn = new DistinguishedName(stringDn); System.out.println(stringDn); System.out.println(dn); {code} Prints out: {noformat} ou="Foo + Bar",cn=some,cn=org ou=\"Foo + Bar\",cn=some,cn=org {noformat} The effect is the quotes have been converted from delimiters to part of the value.

I think it would be fine if it normalized the DN to the preferred method of handling special characters -- escaping them. {noformat} ou=Foo + Bar,cn=some,cn=org {noformat}

rwinch commented 9 years ago

rwinch said: {quote} The effect is the quotes have been converted from delimiters to part of the value. {quote}

I don't understand why you feel like this is a bug. If you do not want the quotes as part of the value, do not include the quotes.

If we change this behavior, how would someone express that they wanted quotes in the value?

rwinch commented 9 years ago

rwinch said: Resolving as invalid. If you disagree and can provide explanation for my questions in the previous comment, please open a new ticket. Otherwise the solution is to not include the " in the first place.