directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r748560 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
Date Fri, 27 Feb 2009 15:39:24 GMT
Author: elecharny
Date: Fri Feb 27 15:39:24 2009
New Revision: 748560

URL: http://svn.apache.org/viewvc?rev=748560&view=rev
Log:
Fixed an error message. If the PrincipalDN was not found, the server sent back a Referral
error. Not very cool ...

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java?rev=748560&r1=748559&r2=748560&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
Fri Feb 27 15:39:24 2009
@@ -150,8 +150,16 @@
                 // this is OK
             }
 
-            if ( principalEntry == null || 
-                 principalEntry.getOriginalEntry().contains( SchemaConstants.OBJECT_CLASS_AT,

+            if ( principalEntry == null )
+            {
+                LdapResult result = bindRequest.getResultResponse().getLdapResult();
+                result.setErrorMessage( "Bind principalDn has not been found in the server."
);
+                result.setResultCode( ResultCodeEnum.INVALID_CREDENTIALS );
+                ldapSession.getIoSession().write( bindRequest.getResultResponse() );
+                return;
+            }
+            
+            if (principalEntry.getOriginalEntry().contains( SchemaConstants.OBJECT_CLASS_AT,

                      SchemaConstants.REFERRAL_OC ) )
             {
                 LdapResult result = bindRequest.getResultResponse().getLdapResult();



Mime
View raw message