rwinch / spring-security-jira-to-gh

0 stars 0 forks source link

LDAP-13: DirContextAdapter.getModificationItems() returns password when password unchanged #5

Closed rwinch closed 17 years ago

rwinch commented 17 years ago

Migrated from ["LDAP-13":https://jira.spring.io/browse/LDAP-13]

Hello,

This could be a problem say if:

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

Best Regards, Jasper

rwinch commented 17 years ago

["Jasper Blues":https://jira.spring.io/secure/ViewProfile.jspa?name=jasper.blues] said:

I'm not sure if this effects version 1.2. I stepped through with a debugger and couldn't reproduce. isChanged() still reports false changes when the argument is byte[], however collect modificationItems later does an .equals() on the BasicAttribute. . . . isChanged() should probably still be fixed.

rwinch commented 17 years ago

["Mattias Hellborg Arthursson":https://jira.spring.io/secure/ViewProfile.jspa?name=marthursson] said:

Compare this to issue LDAP-46 (http://opensource.atlassian.com/projects/spring/browse/LDAP-46). This seems quite similar, and as in my comment to that issue I do think that it should be addressed, but that needs to be done in a generic and configurable way.

rwinch commented 17 years ago

["Mattias Hellborg Arthursson":https://jira.spring.io/secure/ViewProfile.jspa?name=marthursson] said:

Removed the isChanged() method entirely, as it didn't do much good anyway (all the necessary comparisons are made in getModificationItems). Also improved value comparison by using Attribute.contains() (actuallt, Attribute.remove()) to determine Attribute value equality. This should allow for Attribute implementations to do syntactical comparisons on Attribute values. Nevertheless, the byte array problem is solved (as BasicAttributes.contains checks if a value is an array).