directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1639394 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
Date Thu, 13 Nov 2014 17:01:16 GMT
Author: elecharny
Date: Thu Nov 13 17:01:16 2014
New Revision: 1639394

URL: http://svn.apache.org/r1639394
Log:
Fixed a race condition in the Bind handling

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java?rev=1639394&r1=1639393&r2=1639394&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
Thu Nov 13 17:01:16 2014
@@ -162,7 +162,13 @@ public class BindRequestHandler extends 
                 LdapResult result = bindRequest.getResultResponse().getLdapResult();
                 result.setDiagnosticMessage( "Bind principalDn points to referral." );
                 result.setResultCode( ResultCodeEnum.INVALID_CREDENTIALS );
+
+                // Reset the session now
+                ldapSession.setAnonymous();
+
+                // Write the response
                 ldapSession.getIoSession().write( bindRequest.getResultResponse() );
+
                 return;
             }
 
@@ -246,6 +252,11 @@ public class BindRequestHandler extends 
 
             result.setDiagnosticMessage( msg );
             bindRequest.getResultResponse().addAllControls( bindContext.getResponseControls()
);
+
+            // Before writing the response, be sure the session is set to anonymous
+            ldapSession.setAnonymous();
+
+            // Write the response
             ldapSession.getIoSession().write( bindRequest.getResultResponse() );
         }
         finally



Mime
View raw message