Fix for LDAP-97: DistinguishedName now accepts '\r' as input, as specified in LDAP v3 RFC.

This commit is contained in:
Mattias Arthursson
2008-10-22 12:56:42 +00:00
parent 7b24ab0c0c
commit ae978b9992
2 changed files with 11 additions and 3 deletions

View File

@@ -46,8 +46,8 @@ PARSER_END(DnParserImpl)
TOKEN: { <#ALPHA: ["a"-"z", "A"-"Z"] > }
TOKEN: { <#DIGIT: ["0"-"9"]> }
TOKEN: { <#STRINGCHAR: ~[",","=","\r","+","<",">","#",";","\\","\""]> }
TOKEN: { <#STRINGENDCHAR: ~[",","=","\r","+","<",">","#",";","\\","\""," "]> }
TOKEN: { <#STRINGCHAR: ~[",","=","+","<",">","#",";","\\","\""]> }
TOKEN: { <#STRINGENDCHAR: ~[",","=","+","<",">","#",";","\\","\""," "]> }
TOKEN: { <#SPECIAL: [",","=","\r","+","<",">","#",";"]> }
TOKEN: { <#HEXCHAR: ["0"-"9","a"-"f","A"-"F"]> }
TOKEN: { <#HEXPAIR: <HEXCHAR> <HEXCHAR>> }

View File

@@ -477,7 +477,7 @@ public class DistinguishedNameTest extends TestCase {
DistinguishedName name = new DistinguishedName("cn=jo\"hn doe");
assertNotNull(name);
}
public void testAppendChained() {
DistinguishedName tested = new DistinguishedName("dc=mycompany,dc=com");
tested.append("ou", "company1").append("cn", "john doe");
@@ -498,4 +498,12 @@ public class DistinguishedNameTest extends TestCase {
assertTrue(true);
}
}
/**
* Test for LDAP-97.
*/
public void testDistinguishedNameWithCRParsesProperly() {
DistinguishedName name = new DistinguishedName("cn=foo \r bar");
assertNotNull(name);
}
}