Issue Details (XML | Word | Printable)

Key: DIRSERVER-169
Type: Bug Bug
Status: Closed Closed
Resolution: Later
Priority: Major Major
Assignee: Alex Karasulu
Reporter: Luke Taylor
Votes: 0
Watchers: 0
Operations

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

Incorrect SearchResult name and "compare" failure using CoreContextFactory

Created: 31/Jan/06 12:02 AM   Updated: 25/Aug/07 09:18 PM
Return to search
Component/s: core
Affects Version/s: 1.5.0, 1.0.2, 1.0.1, 1.0, 1.0-RC4, 1.0-RC3, 1.0-RC2, 1.0-RC1, pre-1.0
Fix Version/s: 1.5.1

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works DIRSERVER169TestCase.java 2006-08-20 10:45 PM Luke Taylor 4 kB
Java Source File Licensed for inclusion in ASF works LdapTestServer.java 2006-08-19 06:27 PM Luke Taylor 8 kB
Zip Archive Licensed for inclusion in ASF works TestCase.zip 2006-01-31 12:04 AM Luke Taylor 4 kB
Environment:
OS X,
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83)
Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing)
Issue Links:
Reference
 

Resolution Date: 25/Aug/07 09:18 PM


 Description  « Hide
Attached is a test case following on from my post a while back to the mailing list, viz:

My setup is like this:

I have a simple DIT with a root "dc=acegisecurity,dc=org". This has two subcontexts "ou=people" and "ou=groups" for my users and roles respectively. When the test base class instantiated, I create a
MutableStartupConfiguration and add a partition to it with the suffix "dc=acegisecurity,dc=org". I then create a context with this configuration as follows:

    env.setProperty( Context.PROVIDER_URL, "dc=acegisecurity,dc=org" );
    env.setProperty( Context.INITIAL_CONTEXT_FACTORY,
             CoreContextFactory.class.getName());
    env.putAll( cfg.toJndiEnvironment() );

    serverContext = new InitialDirContext( env );

When I need a context in my tests it is created the same way.

Bind authentication works fine in both scenarios. I have problems with two things when trying to use CoreContextFactory :

1. The name returned by a search. When I do a search for a user in the directory, I get back the full DN rather than the name relative to the context I search in. So if I call

   ctx.search("ou=people", "(uid={0})", new String[] {"bob"}, ctls);

on a context obtained as above, I get back a SearchResult with name

"uid=bob,ou=people,dc=acegisecurity,dc=org"

whereas with the full server (or OpenLDAP) I get

"uid=bob"

as expected. This then unfortunately leads to an attempt to bind with an an unknown DN which causes the infinite recursion problem.

2. Performing "compare" operations. I had problems with this before, as reported in

http://issues.apache.org/jira/browse/DIRLDAP-77

but this now works with the full server, thanks to Emmanuel's speedy response. Running the same search code against a context obtained from CoreContextFactory fails however. A compare is never performed and the search returns an empty enumeration. Is there some way I can get my client code (as posted in JIRA):

     SearchControls ctls = new SearchControls();
     ctls.setReturningAttributes(new String[0]);
     ctls.setSearchScope(SearchControls.OBJECT_SCOPE);

     String filter = "(userPassword={0})";
     NamingEnumeration results = ctx.search(dn, filter, new
           Object[]{password.getBytes()}, ctls);

to trigger a compare call on the context? The compare/search also fails for non-binary attributes.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Luke Taylor made changes - 31/Jan/06 12:04 AM
Field Original Value New Value
Attachment TestCase.zip [ 12322481 ]
Alex Karasulu made changes - 07/Feb/06 02:39 PM
Project Directory LDAP [ 10514 ] ApacheDS [ 12310260 ]
Key DIRLDAP-87 DIRSERVER-169
Alex Karasulu made changes - 10/Feb/06 02:14 PM
Component/s core [ 12310713 ]
Alex Karasulu made changes - 17/Aug/06 09:06 PM
Assignee Alex Karasulu [ akarasulu ]
Alex Karasulu made changes - 17/Aug/06 09:06 PM
Status Open [ 1 ] In Progress [ 3 ]
Luke Taylor made changes - 19/Aug/06 06:27 PM
Attachment LdapTestServer.java [ 12339171 ]
Luke Taylor made changes - 20/Aug/06 10:45 PM
Attachment DIRSERVER169TestCase.java [ 12339196 ]
Alex Karasulu made changes - 27/Aug/06 12:17 AM
Link This issue is related to DIRSERVER-715 [ DIRSERVER-715 ]
Alex Karasulu made changes - 27/Aug/06 07:07 AM
Resolution Fixed [ 1 ]
Fix Version/s 1.0-RC4 [ 12311053 ]
Fix Version/s 1.1.0 [ 12310790 ]
Status In Progress [ 3 ] Closed [ 6 ]
Emmanuel Lecharny made changes - 03/Dec/06 10:30 PM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Emmanuel Lecharny made changes - 25/Jan/07 04:12 PM
Fix Version/s 1.0-RC4 [ 12311053 ]
Fix Version/s 1.0.1 [ 12312091 ]
Alex Karasulu made changes - 13/Feb/07 05:35 PM
Affects Version/s 1.0.1 [ 12312091 ]
Fix Version/s 1.5.0 [ 12310790 ]
Fix Version/s 1.0.1 [ 12312091 ]
Affects Version/s 1.5.0 [ 12310790 ]
Fix Version/s 1.5.1 [ 12310792 ]
Fix Version/s 1.0.2 [ 12312309 ]
Alex Karasulu made changes - 23/Apr/07 04:43 AM
Affects Version/s 1.0-RC3 [ 12310791 ]
Affects Version/s 1.0-RC2 [ 12310781 ]
Affects Version/s 1.0-RC1 [ 12310780 ]
Affects Version/s 1.0-RC4 [ 12311053 ]
Affects Version/s pre-1.0 [ 12310782 ]
Affects Version/s 1.0.2 [ 12312309 ]
Affects Version/s 1.0 [ 12312043 ]
Alex Karasulu made changes - 23/Apr/07 04:44 AM
Fix Version/s 1.0.2 [ 12312309 ]
Alex Karasulu made changes - 25/Aug/07 09:18 PM
Resolution Later [ 7 ]
Status Reopened [ 4 ] Closed [ 6 ]