Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-M20
    • Labels:
      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 ! }

      }

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        Closing the resolved issues.

        Show
        elecharny Emmanuel Lecharny added a comment - Closing the resolved issues.
        Hide
        elecharny Emmanuel Lecharny added a comment -
        Show
        elecharny Emmanuel Lecharny added a comment - Fix with http://svn.apache.org/r1501300
        Hide
        elecharny Emmanuel Lecharny added a comment -

        The pb is more in the LdifParser code.

        When we have a LDIF file like :

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

        we generate a Modification instance which contains an Attribute with a null value.

        But for AttributeType allowing the existence of null values, deleting the null value will need to be able to parse :

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

        and to have a Modification containing the Attribute <userPassword, null>

        At this point, we can't distinguish between the deletion of the complete attribute and the deletion of the null value of an Attribute.

        The Modification class should have a flag to distinguish those two cases.

        Show
        elecharny Emmanuel Lecharny added a comment - The pb is more in the LdifParser code. When we have a LDIF file like : dn: cn=test,ou=users,ou=system changetype: modify delete: userPassword - we generate a Modification instance which contains an Attribute with a null value. But for AttributeType allowing the existence of null values, deleting the null value will need to be able to parse : dn: cn=test,ou=users,ou=system changetype: modify delete: userPassword userPassword: - and to have a Modification containing the Attribute <userPassword, null> At this point, we can't distinguish between the deletion of the complete attribute and the deletion of the null value of an Attribute. The Modification class should have a flag to distinguish those two cases.

          People

          • Assignee:
            elecharny Emmanuel Lecharny
            Reporter:
            elecharny Emmanuel Lecharny
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development