Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-120

Deleted an attribute leads to an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.0.0-M20
    • None

    Description

      Modifying an entry and removing an attribute creates a LDIF enry like :

      dn: cn=test,ou=users,ou=system
      changetype: modify
      delete: userPassword
      -

      which is transformed to a ModifyRequest with a Modification containing the attribute and a 'null' value, which is wrong.

      The AttributeUtils.toApiAttributes() method uses :

      ...
      for ( NamingEnumeration<?> values = jndiAttribute.getAll(); values.hasMoreElements(); )
      {
      Object value = values.nextElement();

      if ( value instanceof String )

      { attribute.add( ( String ) value ); }

      else if ( value instanceof byte[] )

      { attribute.add( ( byte[] ) value ); }

      else

      { attribute.add( ( String ) null ); <-------------- Wrong ! }

      }

      Attachments

        Activity

          People

            elecharny Emmanuel Lécharny
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: