Results 1 to 2 of 2

Thread: DirContextAdapter.getModificationItems() returns password when password unchanged

  1. #1

    Default DirContextAdapter.getModificationItems() returns password when password unchanged

    Hello,

    * We have a Person.java pojo containing a password property of type byte[]. The password property is set to and from the Sun Directory Server using a ContextMapper/ContextAssembler implementation.
    * Problem: is DirContextAdapter.getModificationsItems() always returns the password attribute as an updated attribute. This is because the two byte arrays have a different hashcode despite having identical content. Therefore b1[].equals(b2[]) returns false.

    This could be a problem say if:

    * Service subscriber 1 gets a handle to a Person pojo
    * Service subscriber 2 gets a handle to a Person pojo, updates password attribute and saves.
    * Service subscriber 1 updates "golden rating" attribute and saves. The new password is blown away.


    Possible Solution: Perhaps DirContextAdapter.isChanged() should use Arrays.equals(byte[], byte[]) for attributes of type byte[].



    Best Regards,
    Jasper

  2. #2
    Join Date
    Mar 2005
    Location
    Landskrona, Sweden
    Posts
    505

    Default

    This is probably something we should fix. Please post a jira issue.
    Mattias Arthursson
    Jayway AB (www.jayway.se)
    Spring-LDAP project member

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •