Issue Details (XML | Word | Printable)

Key: DIRSERVER-318
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alex Karasulu
Reporter: Stefan Zoerner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Adding an already existing attribute value with a modify operation does not cause an error.

Created: 01/Sep/05 06:57 AM   Updated: 10/Feb/06 12:34 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works ModifyAddTest.java 2005-09-01 07:03 AM Stefan Zoerner 7 kB

Resolution Date: 13/Sep/05 12:41 AM


 Description  « Hide
If you try to add an attribute value which is already present within the entry, no error occurs.
After the execution of the modify operation, the value appears twice in the entry instead.

As a consequence, it is possible for instance to create an entry like this:

---

dn: cn=Stefan Zoerner,ou=users,ou=system
sn: Zoerner
objectClass: top
objectClass: top
objectClass: person
cn: Stefan Zoerner

---

Expected behavior is error code 20, which indicates that the attribute value specified in a modify or add operation already exists as a value for that attribute.
I will add a test case as usual which demonstrates the bug with a person entry.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Stefan Zoerner added a comment - 01/Sep/05 07:03 AM
Here is a test case, which demonstrates the error with the description attribute of a person entry. But the bug occurs with other attributes, even objectClass as well. The critical method is testAddExistingAttributeValue, which fails.

Stefan Zoerner made changes - 01/Sep/05 07:03 AM
Field Original Value New Value
Attachment ModifyAddTest.java [ 12312119 ]
Alex Karasulu made changes - 12/Sep/05 09:28 AM
Status Open [ 1 ] In Progress [ 3 ]
Repository Revision Date User Message
ASF #280356 Mon Sep 12 15:40:02 UTC 2005 akarasulu changes ...

 o worked on and fixed issue posted by Stefan Zoerner: DIREVE-241 here
   http://issues.apache.org/jira/browse/DIREVE-241
 o fixed another bug with the result code assosciated with the LDAP version of
   the AttributeInUseException within ldap-common
 o added code to the ExceptionService to check whether or not an attribute being
   added in a modify operation already exists - if it does an exception is
   raised
Files Changed
MODIFY /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java
MODIFY /directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/exception/LdapAttributeInUseException.java
ADD /directory/apacheds/trunk/main/src/test/org/apache/ldap/server/ModifyAddTest.java

Alex Karasulu added a comment - 13/Sep/05 12:41 AM
Committed in revision 289356 here:

http://svn.apache.org/viewcvs.cgi?view=rev&rev=280356

Alex Karasulu made changes - 13/Sep/05 12:41 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Fix Version/s 0.9.3 [ 12310193 ]
Alex Karasulu made changes - 13/Sep/05 12:42 AM
Affects Version/s 0.9.2 [ 12310192 ]
Affects Version/s 0.9.3 [ 12310193 ]
Stefan Zoerner added a comment - 15/Sep/05 08:19 PM
I have rebuilded the server, and tested the behavior programmatically (test cases) and with a GUI client. The described error does not occur any more, therefore I close the issue.

Stefan Zoerner made changes - 15/Sep/05 08:19 PM
Status Resolved [ 5 ] Closed [ 6 ]
Alex Karasulu made changes - 10/Feb/06 12:34 PM
Fix Version/s 0.9.3 [ 12310193 ]
Affects Version/s 0.9.2 [ 12310192 ]
Key DIREVE-241 DIRSERVER-318
Project Directory Server [ 10516 ] Directory ApacheDS [ 12310260 ]