Issue Details (XML | Word | Printable)

Key: DIRSERVER-791
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Stefan Seelmann
Votes: 0
Watchers: 0
Operations

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

Some issues regarding attribute modification

Created: 03/Dec/06 06:16 PM   Updated: 05/Jan/07 03:25 PM
Return to search
Component/s: None
Affects Version/s: 1.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works DIRSERVER791.java 2006-12-03 09:09 PM Stefan Zoerner 5 kB
Environment: LDIF tested with ELBE import and ldapmodify command line tool.

Resolution Date: 05/Jan/07 01:52 PM


 Description  « Hide
There are some issues regarding attribute modification:

This entry is used to start:
#
dn: cn=test,dc=example,dc=com
changetype: add
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
objectclass: top
cn: test
cn: aaa
sn: test
#


1.)
Removal of a value from RDN attribute which is not part of the RDN is not possible
#
dn: cn=test,dc=example,dc=com
changetype: modify
delete: cn
cn: aaa
-
#

However replacing works:
#
dn: cn=test,dc=example,dc=com
changetype: modify
replace: cn
cn: test
-
#

2.)
It is possible to add an value to objectclass, which isn't a valid objectclass. The server returns an error, but nevertheless the invalid value is stored. I think this should be rejected from server.
#
dn: cn=test,dc=example,dc=com
changetype: modify
add: objectclass
objectclass: test
-
#

3.)
It is possible to add an attribute to the entry that is not allowed according the objectclasses. The server should reject this.
#
dn: cn=test,dc=example,dc=com
changetype: modify
add: bootParameter
bootParameter: test
-
#



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ersin Er added a comment - 03/Dec/06 07:56 PM
A test case for demostrating the bug(s) and even a patch are welcome ;-)

Stefan Zoerner added a comment - 03/Dec/06 08:01 PM
I volunteer for the test case.

Stefan Zoerner made changes - 03/Dec/06 09:06 PM
Attachment DIRSERVER791.java [ 12346303 ]
Stefan Zoerner added a comment - 03/Dec/06 09:09 PM
Here is a JUnit test to demonstrate all the things the reporter (Stefan) describes, and he is totally right. I have created 4 method within the class -- 3 fail (2 errors, 1 failure).

The test passes completely with the following servers (all of them on Solaris9 SPARC):
- Sun Java System Directory Server 5.2
- IBM Tivoli Directory Server 6.0
- OpenLDAP 2.3


Stefan Zoerner made changes - 03/Dec/06 09:09 PM
Attachment DIRSERVER791.java [ 12346305 ]
Emmanuel Lecharny added a comment - 05/Jan/07 11:04 AM
I have ported the test case into apacheds-core-unit, and I get two errors ( a NPE for testDefect1A and a non existant AttributeType test for testDefect2).

The second error does not seems to be an error to me : we don't have a 'test' attributeType in any schema so far.

I need to investigate those test a little bit further.

btw : we need to define a way to write valid unit tests : we can't assume a server is up and running when we launch the tests. We have two ways to do tests :
- in apacheds-core-unit, where we don't pass through the encoding/decoding layer (so it's much faster)
- in apacheds-server-unit where we go through the whole stuff, using an embeded ADS.

Unit tests must be using one of those two methods, but I think we must favor the second one.

Emmanuel Lecharny added a comment - 05/Jan/07 01:52 PM
There was a nasty bug in the way modify requests were handled deep into the server : attribute was removed entirely, instead of just removing the values.

It has been fixed. Another problem was fixed : we now are working with the OID of attributes, instead of their names (or alias). Otherwise, we can have some NPE if we tried to compare OID with a name.

The testDefect2 was wrong : the server thrown a NamingExcepion which was not handled, this we got a failing test. Fixed.

Emmanuel Lecharny made changes - 05/Jan/07 01:52 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Repository Revision Date User Message
ASF #493037 Fri Jan 05 14:12:40 UTC 2007 elecharny Fix for DIRSERVER-791. The MODIFY operation didn't handled correctly
values modification : the attribute itself was completly removed
even if just a value was to be removed.
Fixed another problem : when comparing the RDN with the attribute, if the
attribyteType was not an OID, then there was a difference even if oid(RDN) = attributeType OID.
A new parameter (OIDRegistry) was added to all the method to handle that case
Also fixed the testcase
Files Changed
MODIFY /directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
MODIFY /directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
MODIFY /directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java

Repository Revision Date User Message
ASF #493038 Fri Jan 05 14:13:45 UTC 2007 elecharny Added the testCase Stefan Szoerner submitted to test DIRSERVER-791
Files Changed
ADD /directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791ITest.java

Repository Revision Date User Message
ASF #493045 Fri Jan 05 15:15:15 UTC 2007 elecharny Fixed DIRSERVER-791
Files Changed
MODIFY /directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
MODIFY /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
MODIFY /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java

Repository Revision Date User Message
ASF #493046 Fri Jan 05 15:15:21 UTC 2007 elecharny Fixed DIRSERVER-791
Files Changed
ADD /directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791ITest.java


Emmanuel Lecharny made changes - 05/Jan/07 03:25 PM
Status Resolved [ 5 ] Closed [ 6 ]