[ http://issues.apache.org/jira/browse/DIREVE-282?page=comments#action_12332898 ]
Alex Karasulu commented on DIREVE-282:
--------------------------------------
It's a good think that we know the LdapName in JDK 1.5 is not up to snuff with the RFC. I
could have sworn that periods were allowed but I was way off. I'd rather not relax the parser
either. Let's stay as close to the RFC as possible.
> Attribute names with periods cannot be used in a search filter.
> ---------------------------------------------------------------
>
> Key: DIREVE-282
> URL: http://issues.apache.org/jira/browse/DIREVE-282
> Project: Directory Server
> Type: Bug
> Components: jndi-provider
> Reporter: Enrique Rodriguez
> Assignee: Alex Karasulu
>
> The following filter fails in a DirContext.search(), but it works fine in the JDK (test
cases are below):
> String filter = "(service.Pid=org.apache.dns.factory)";
> javax.naming.directory.InvalidSearchFilterException: Encountered parse exception while
parsing the filter: '(service.Pid=org.apache.dns.factory)' [Root exception is java.text.ParseException:
Parser failure on filter:
> (service.Pid=org.apache.dns.factory)
> Antlr exception trace:
> unexpected char: '.']
> at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:598)
> at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:559)
> ...
> Caused by: java.text.ParseException: Parser failure on filter:
> (service.Pid=org.apache.dns.factory)
> Antlr exception trace:
> unexpected char: '.'
> at org.apache.ldap.common.filter.FilterParserImpl.parse(FilterParserImpl.java:128)
> at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:594)
> ... 17 more
> // works fine
> public void testLdapNameJdk() throws Exception
> {
> new javax.naming.ldap.LdapName( "asdf.asdf=asdf" );
> }
> // Parser failure on name: asdf.asdf=asdf
> public void testLdapNameApacheDs() throws Exception
> {
> new org.apache.ldap.common.name.LdapName( "asdf.asdf=asdf" );
> }
> org.apache.ldap.common.exception.LdapInvalidNameException: Parser failure on name:
> asdf.asdf=asdf
> Antlr exception trace:
> line 1:5: unexpected char: '.'
> at org.apache.ldap.common.name.antlrTypeLexer.nextToken(antlrTypeLexer.java:154)
> at antlr.TokenStreamSelector.nextToken(TokenStreamSelector.java:64)
> at antlr.TokenBuffer.fill(TokenBuffer.java:69)
> at antlr.TokenBuffer.LA(TokenBuffer.java:80)
> at antlr.LLkParser.LA(LLkParser.java:52)
> at antlr.Parser.match(Parser.java:212)
> at org.apache.ldap.common.name.antlrNameParser.attributeTypeAndValue(antlrNameParser.java:185)
> at org.apache.ldap.common.name.antlrNameParser.nameComponent(antlrNameParser.java:120)
> at org.apache.ldap.common.name.antlrNameParser.name(antlrNameParser.java:69)
> at org.apache.ldap.common.name.DnParser.parse(DnParser.java:187)
> at org.apache.ldap.common.name.LdapName.<init>(LdapName.java:93)
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|