Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1367

Protocol error when requesting attribute with the space character only

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.4
    • 1.5.5
    • ldap
    • None

    Description

      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:

      1. 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

      Attachments

        Activity

          People

            elecharny Emmanuel Lécharny
            seelmann Stefan Seelmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: