directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] Closed: (DIRSERVER-228) ClassCastException when performing 'compare' on userPassword
Date Sat, 21 Apr 2007 11:20:17 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny closed DIRSERVER-228.
---------------------------------------


Closing all issues created in 2005 and before which are marked resolved

> ClassCastException when performing 'compare' on userPassword
> ------------------------------------------------------------
>
>                 Key: DIRSERVER-228
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-228
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: pre-1.0
>            Reporter: Luke Taylor
>             Fix For: pre-1.0
>
>
> Using the latest 0.9.4 snapshots and also code checked out and built today - (but had
to include an older version of Mina with the latter due to ClassNotFoundExceptions for MessageHandler
):
> I'm making a call to apache-ds to perform a comparison operation on a user's password
and I'm get a ClassCastException at line 369 of DefaultDirectoryPartitionNexus:
>             String attrVal = ( String ) normalizer.normalize( attr.get( ii ) );
> when attr is userPassword (a byte array) and the normalizer is a no-op, so the cast to
String fails.
> javax.naming.NamingException: [LDAP: error code 1 - failed to compare entry cn=Bob,ou=people,dc=acegisecurity,dc=org:
> org.apache.ldap.server.interceptor.InterceptorException: Unexpected exception. [Root
exception is java.lang.ClassCastException: [B]
> 	at org.apache.ldap.server.interceptor.InterceptorChain.throwInterceptorException(InterceptorChain.java:1368)
> 	at org.apache.ldap.server.interceptor.InterceptorChain.access$700(InterceptorChain.java:49)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:983)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.authz.AuthorizationService.compare(AuthorizationService.java:917)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.interceptor.BaseInterceptor.compare(BaseInterceptor.java:210)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	at org.apache.ldap.server.normalization.NormalizationService.compare(NormalizationService.java:236)
> 	at org.apache.ldap.server.interceptor.InterceptorChain.compare(InterceptorChain.java:564)
> 	at org.apache.ldap.server.partition.DirectoryPartitionNexusProxy.compare(DirectoryPartitionNexusProxy.java:232)
> 	at org.apache.ldap.server.partition.DirectoryPartitionNexusProxy.compare(DirectoryPartitionNexusProxy.java:221)
> 	at org.apache.ldap.server.jndi.ServerLdapContext.compare(ServerLdapContext.java:168)
> 	at org.apache.ldap.server.protocol.support.CompareHandler.messageReceived(CompareHandler.java:61)
> 	at org.apache.mina.handler.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:95)
> 	at org.apache.ldap.server.protocol.LdapProtocolProvider$LdapProtocolHandler.messageReceived(LdapProtocolProvider.java:396)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:189)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:494)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:761)
> 	at org.apache.mina.filter.LoggingFilter.messageReceived(LoggingFilter.java:87)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:494)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:761)
> 	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:91)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:494)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:761)
> 	at org.apache.mina.filter.ThreadPoolFilter.processEvent(ThreadPoolFilter.java:665)
> 	at org.apache.mina.filter.ThreadPoolFilter$Worker.processEvents(ThreadPoolFilter.java:421)
> 	at org.apache.mina.filter.ThreadPoolFilter$Worker.run(ThreadPoolFilter.java:376)
> Caused by: java.lang.ClassCastException: [B
> 	at org.apache.ldap.server.partition.DefaultDirectoryPartitionNexus.compare(DefaultDirectoryPartitionNexus.java:369)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$1.compare(InterceptorChain.java:71)
> 	at org.apache.ldap.server.interceptor.InterceptorChain$Entry$1.compare(InterceptorChain.java:975)
> 	... 41 more
> ]; remaining name 'cn=Bob,ou=people'
> 	at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3025)
> 	at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)
> 	at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2737)
> 	at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1803)
> 	at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1731)
> 	at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1748)
> 	at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:394)
> 	at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:376)
> 	at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:358)
> 	at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:267)
> 	at org.acegisecurity.providers.ldap.authenticator.PasswordComparisonAuthenticator.doPasswordCompare(PasswordComparisonAuthenticator.java:117)
> 	at org.acegisecurity.providers.ldap.authenticator.PasswordComparisonAuthenticator.authenticate(PasswordComparisonAuthenticator.java:81)
> 	at org.acegisecurity.providers.ldap.authenticator.PasswordComparisonAuthenticatorTests.testLdapCompareSucceedsWithCorrectPassword(PasswordComparisonAuthenticatorTests.java:35)
> Client code is:
>         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);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message