directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <directory-...@incubator.apache.org>
Subject [jira] Commented: (DIREVE-282) Attribute names with periods cannot be used in a search filter.
Date Sun, 23 Oct 2005 06:33:08 GMT
    [ http://issues.apache.org/jira/browse/DIREVE-282?page=comments#action_12332886 ] 

Emmanuel Lecharny commented on DIREVE-282:
------------------------------------------

This is a problem, as RFC 2251 states that :

4.1.4 Attribute Type
...These names MUST begin with a letter, and only  contain ASCII letters, digit characters
and hyphens...

So '.' is not allowed.

However, we can relax easily the parser to accept a dot withour a problem.

> 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


Mime
View raw message