directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DIRSERVER-1367) Protocol error when requesting attribute with the space character only
Date Mon, 18 May 2009 11:29:45 GMT

    [ https://issues.apache.org/jira/browse/DIRSERVER-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710338#action_12710338
] 

Emmanuel Lecharny commented on DIRSERVER-1367:
----------------------------------------------

Ok, I was completely wrong. The PDU I was decoding weren't the one associated with the search
with a space in the attributes field. In fact, I got an exception which was not handled correctly.

If the attributes is empty then the server works fine. However, if you inject a space (ore
more than one space), it considers it as a valid attribute, try to put it in an internal structure
used to store the attributes list, and fails because the String is trimmed, leading to an
empty string, which is not allowed.

I have a fix for this, I will apply it asap.

> Protocol error when requesting attribute with the space character only
> ----------------------------------------------------------------------
>
>                 Key: DIRSERVER-1367
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1367
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: 1.5.4
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>             Fix For: 1.5.5
>
>
> When setting the returning attributes of a search to the space character the server returns
a protocol error:
> ldapsearch -H ldap://localhost:10389 -x -D "uid=admin,ou=system" -W -b "ou=users,ou=system"
-s base -a always "(objectClass=*)" " "
> The result is the following error:
> # extended result response
> extended: 1.3.6.1.4.1.1466.20036
> data:
> result: 2 Protocol error
> text: PROTOCOL_ERROR: The server will disconnect!
> Here is a testcase using JNDI:
> Index: src/test/java/org/apache/directory/server/operations/search/SearchIT.java
> ===================================================================
> --- src/test/java/org/apache/directory/server/operations/search/SearchIT.java	(revision
774248)
> +++ src/test/java/org/apache/directory/server/operations/search/SearchIT.java	(working
copy)
> @@ -1321,6 +1321,24 @@
>      
>      
>      /**
> +     * Check if no error occurs if " " is requested.
> +     */
> +    @Test
> +    public void testSearchUserAttributes_Space() throws Exception
> +    {
> +        LdapContext ctx = ( LdapContext ) getWiredContext( ldapService ).lookup( BASE
);
> +        SearchControls ctls = new SearchControls();
> +
> +        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
> +        ctls.setReturningAttributes( new String[]
> +            { " " } );
> +
> +        NamingEnumeration<SearchResult> result = ctx.search( HEATHER_RDN, FILTER,
ctls );
> +        result.close();
> +    }
> +
> +
> +    /**
>       * Check if user and operational attributes are present, if both "*" and "+" are
requested.
>       */
>      @Test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message