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

Deserialized Dn loses bytes field resulting in null dn, treated as Root DSE when encoded in ModifyRequests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-RC1
    • Labels:
      None
    • Flags:
      Patch

      Description

      The Dn class is Externalizable and has fields normName and bytes. The readExternal/writeExternal methods preserve the normName field, but ignore the bytes field. The Dn class has a static method, getBytes, which will return null if the Dn instance had been deserialized. The ModifyRequestDecorator uses the Dn getBytes method when encoding the entry name onto the PDU, resulting in a zero length sequence if the Dn had been deserialized, therefore treated like the Root DSE.

      1. Dn-Serialize-null-bytes-Fix.patch
        0.6 kB
        Gerald Turner
      2. Dn-Serialize-null-bytes-Test.patch
        0.8 kB
        Gerald Turner

        Activity

        Hide
        gturner@unzane.com Gerald Turner added a comment -

        Unit test exhibiting the bug with serialization

        Show
        gturner@unzane.com Gerald Turner added a comment - Unit test exhibiting the bug with serialization
        Hide
        gturner@unzane.com Gerald Turner added a comment -

        Fix for ensuring bytes field is populated during readExternal

        Show
        gturner@unzane.com Gerald Turner added a comment - Fix for ensuring bytes field is populated during readExternal
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Many thanks Gerald !

        I'll apply the patch asap !

        Show
        elecharny Emmanuel Lecharny added a comment - Many thanks Gerald ! I'll apply the patch asap !
        Hide
        elecharny Emmanuel Lecharny added a comment -
        Show
        elecharny Emmanuel Lecharny added a comment - Patch applied : http://svn.apache.org/viewvc?rev=1728369&view=rev Thanks !

          People

          • Assignee:
            Unassigned
            Reporter:
            gturner@unzane.com Gerald Turner
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development