object scope search on non-existant DN gives IllegalArgumentException: 
"Argument 'an_obj1' is null" 
----------------------------------------------------------------------------------------------------

                 Key: DIRSERVER-759
                 URL: http://issues.apache.org/jira/browse/DIRSERVER-759
             Project: Directory ApacheDS
          Issue Type: Bug
          Components: core
    Affects Versions: 1.1.1
         Environment: N/A
            Reporter: Norbert Reilly


Fire up a vanilla empty ApacheDS 1.1 instance, and then attempt an object scope 
search on a non-existant base DN like "cn=admin,ou=system", with filter 
"(objectclass=*)" returning no attributes. 

Instead of a NameNotFoundException exception you get the following stack trace:

java.lang.IllegalArgumentException: Argument 'an_obj1' is null
        at 
org.apache.directory.shared.ldap.util.BigIntegerComparator.compare(BigIntegerComparator.java:56)
        at 
org.apache.directory.server.core.partition.impl.btree.IndexComparator$1.compare(IndexComparator.java:45)
        at java.util.TreeMap.compare(TreeMap.java:1093)
        at java.util.TreeMap.getEntry(TreeMap.java:347)
        at java.util.TreeMap.containsKey(TreeMap.java:204)
        at java.util.TreeSet.contains(TreeSet.java:196)
        at 
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable.has(JdbmTable.java:560)
        at 
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex.hasValue(JdbmIndex.java:394)
        at 
org.apache.directory.server.core.partition.impl.btree.LeafEvaluator.evalPresence(LeafEvaluator.java:242)
        at 
org.apache.directory.server.core.partition.impl.btree.LeafEvaluator.evaluate(LeafEvaluator.java:130)
        at 
org.apache.directory.server.core.partition.impl.btree.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:103)
        at 
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator$2.assertCandidate(ExpressionEnumerator.java:257)
        at 
org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.prefetch(IndexAssertionEnumeration.java:161)
        at 
org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.<init>(IndexAssertionEnumeration.java:66)
        at 
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumConj(ExpressionEnumerator.java:270)
        at 
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumerate(ExpressionEnumerator.java:134)
        at 
org.apache.directory.server.core.partition.impl.btree.DefaultSearchEngine.search(DefaultSearchEngine.java:136)
        at 
org.apache.directory.server.core.partition.impl.btree.BTreePartition.search(BTreePartition.java:404)
        at 
org.apache.directory.server.core.partition.DefaultPartitionNexus.search(DefaultPartitionNexus.java:866)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$1.search(InterceptorChain.java:139)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.search(InterceptorChain.java:1263)
        at 
org.apache.directory.server.core.schema.SchemaService.search(SchemaService.java:192)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.search(InterceptorChain.java:1263)
        at 
org.apache.directory.server.core.authn.AuthenticationService.search(AuthenticationService.java:417)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.search(InterceptorChain.java:1263)
        at 
org.apache.directory.server.core.normalization.NormalizationService.search(NormalizationService.java:326)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain.search(InterceptorChain.java:828)
        at 
org.apache.directory.server.core.partition.PartitionNexusProxy.search(PartitionNexusProxy.java:479)
        at 
org.apache.directory.server.core.partition.PartitionNexusProxy.search(PartitionNexusProxy.java:424)
        at 
org.apache.directory.server.core.jndi.ServerDirContext.search(ServerDirContext.java:579)
        at 
org.apache.directory.server.ldap.support.SearchHandler.messageReceived(SearchHandler.java:323)

The problem seems to be that in the enumerate method in 
ScopeEnumerator.java:67, the following line returns null:

        final BigInteger id = db.getEntryId( snode.getBaseDn() );

but nonetheless a IndexRecord is created and returned anyway. I don't know this 
code well enough to be certain whether a "LdapNameNotFoundException" should be 
thrown at this stage, or whether instead a check for a null IndexRecord id 
should be performed later when actually evaluating the filter. If someone more 
knowledgeable can offer some advice on this point then I can submit a patch and 
testcase.

Note I tested if the same problem occurs in 1.0, and it doesn't.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to