
| Key: |
DIRSERVER-200
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Duplicate
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Luke Taylor
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
20/Jan/06 07:35 AM
|
|
If the following test method is added to the end of SimpleAuthenticationTest in the core-tests module, the code goes into an infinite loop.
public void test11NonExistentUser()
{
Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
env.put( Context.PROVIDER_URL, "ou=system" );
env.put( Context.SECURITY_PRINCIPAL, "uid=idontexist,ou=users,ou=system" );
env.put( Context.SECURITY_CREDENTIALS, "test" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory" );
try {
new InitialContext( env );
fail("Authenticated as non-existent user");
} catch(Exception expected) {
}
}
Line 139 of org.apache.ldap.server.jndi.ServerContext is
if ( ! nexusProxy.hasEntry( dn ) )
{
throw new NameNotFoundException( dn + " does not exist" );
}
But the call to hasEntry(dn) results in an authenticate() call. SimpleAuthenticator then performs a "lookup" operation on the given dn. When the call reaches the ExceptionService, it calls assertHasEntry() on itself:
line 372:
if ( !nextInterceptor.hasEntry( dn ) )
{
LdapNameNotFoundException e = null;
if ( msg != null )
{
e = new LdapNameNotFoundException( msg + dn );
}
else
{
e = new LdapNameNotFoundException( dn.toString() );
}
e.setResolvedName( proxy.getMatchedName( dn, false ) );
throw e;
}
The hasEntry call here fails as expected. However, the subsequent call to getMatchedName results in another call through the interceptor stack, another authenticate(), another lookup from SimpleAuthenticator and then we're stuck.
|
|
Description
|
If the following test method is added to the end of SimpleAuthenticationTest in the core-tests module, the code goes into an infinite loop.
public void test11NonExistentUser()
{
Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
env.put( Context.PROVIDER_URL, "ou=system" );
env.put( Context.SECURITY_PRINCIPAL, "uid=idontexist,ou=users,ou=system" );
env.put( Context.SECURITY_CREDENTIALS, "test" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory" );
try {
new InitialContext( env );
fail("Authenticated as non-existent user");
} catch(Exception expected) {
}
}
Line 139 of org.apache.ldap.server.jndi.ServerContext is
if ( ! nexusProxy.hasEntry( dn ) )
{
throw new NameNotFoundException( dn + " does not exist" );
}
But the call to hasEntry(dn) results in an authenticate() call. SimpleAuthenticator then performs a "lookup" operation on the given dn. When the call reaches the ExceptionService, it calls assertHasEntry() on itself:
line 372:
if ( !nextInterceptor.hasEntry( dn ) )
{
LdapNameNotFoundException e = null;
if ( msg != null )
{
e = new LdapNameNotFoundException( msg + dn );
}
else
{
e = new LdapNameNotFoundException( dn.toString() );
}
e.setResolvedName( proxy.getMatchedName( dn, false ) );
throw e;
}
The hasEntry call here fails as expected. However, the subsequent call to getMatchedName results in another call through the interceptor stack, another authenticate(), another lookup from SimpleAuthenticator and then we're stuck. |
Show » |
made changes - 09/Dec/05 04:54 AM
| Field |
Original Value |
New Value |
|
Link
|
|
This issue is a clone of DIREVE-314
[ DIREVE-314
]
|
made changes - 20/Jan/06 07:34 AM
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Resolution
|
|
Duplicate
[ 3
]
|
made changes - 20/Jan/06 07:34 AM
|
Resolution
|
Duplicate
[ 3
]
|
|
|
Status
|
Resolved
[ 5
]
|
Reopened
[ 4
]
|
made changes - 20/Jan/06 07:35 AM
|
Resolution
|
|
Duplicate
[ 3
]
|
|
Status
|
Reopened
[ 4
]
|
Resolved
[ 5
]
|
made changes - 07/Feb/06 02:41 PM
|
Fix Version/s
|
|
pre-1.0
[ 12310782
]
|
|
Key
|
DIRLDAP-79
|
DIRSERVER-200
|
|
Project
|
Directory LDAP
[ 10514
]
|
ApacheDS
[ 12310260
]
|
|
Component/s
|
|
ldap
[ 12310715
]
|
|
Affects Version/s
|
|
pre-1.0
[ 12310782
]
|
made changes - 21/Apr/07 11:20 AM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|
Thanks for the report !