You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/09/04 09:53:25 UTC

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

Author: kayyagari
Date: Sat Sep  4 07:53:24 2010
New Revision: 992556

URL: http://svn.apache.org/viewvc?rev=992556&view=rev
Log:
o removed the check for empty string
  (this was preventing the server from returning a response with AUTH_METHOD_NOT_SUPPORTED result code when a empty string is passed as SASL mechanism value)

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=992556&r1=992555&r2=992556&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 Sat Sep  4 07:53:24 2010
@@ -524,38 +524,35 @@ public class BindHandler extends LdapReq
         // case #1 : The user does not have a session.
         if ( ldapSession.isAnonymous() )
         {
-            if ( !StringTools.isEmpty( saslMechanism ) )
+            // fist check that the mechanism exists
+            if ( !checkMechanism( saslMechanism ) )
             {
-                // fist check that the mechanism exists
-                if ( !checkMechanism( saslMechanism ) )
-                {
-                    // get out !
-                    sendAuthMethNotSupported( ldapSession, bindRequest );
-
-                    return;
-                }
-
-                // Store the mechanism in the ldap session
-                ldapSession.putSaslProperty( SaslConstants.SASL_MECH, saslMechanism );
-
-                // Get the handler for this mechanism
-                MechanismHandler mechanismHandler = handlers.get( saslMechanism );
-
-                // Store the mechanism handler in the salsProperties
-                ldapSession.putSaslProperty( SaslConstants.SASL_MECH_HANDLER, mechanismHandler );
-
-                // Initialize the mechanism specific data
-                mechanismHandler.init( ldapSession );
-
-                // Get the SaslServer instance which manage the C/R exchange
-                SaslServer ss = mechanismHandler.handleMechanism( ldapSession, bindRequest );
-
-                // We have to generate a challenge
-                generateSaslChallengeOrComplete( ldapSession, ss, bindRequest );
-
-                // And get back
+                // get out !
+                sendAuthMethNotSupported( ldapSession, bindRequest );
+                
                 return;
             }
+            
+            // Store the mechanism in the ldap session
+            ldapSession.putSaslProperty( SaslConstants.SASL_MECH, saslMechanism );
+            
+            // Get the handler for this mechanism
+            MechanismHandler mechanismHandler = handlers.get( saslMechanism );
+            
+            // Store the mechanism handler in the salsProperties
+            ldapSession.putSaslProperty( SaslConstants.SASL_MECH_HANDLER, mechanismHandler );
+            
+            // Initialize the mechanism specific data
+            mechanismHandler.init( ldapSession );
+            
+            // Get the SaslServer instance which manage the C/R exchange
+            SaslServer ss = mechanismHandler.handleMechanism( ldapSession, bindRequest );
+            
+            // We have to generate a challenge
+            generateSaslChallengeOrComplete( ldapSession, ss, bindRequest );
+            
+            // And get back
+            return;
         }
         else if ( ldapSession.isAuthPending() )
         {