directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1233926 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/ core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/ ldap-client-test/src/test/java/org/apache/directory/shared/client...
Date Fri, 20 Jan 2012 14:28:59 GMT
Author: pamarcelot
Date: Fri Jan 20 14:28:59 2012
New Revision: 1233926

URL: http://svn.apache.org/viewvc?rev=1233926&view=rev
Log:
Fix for DIRAPI-68 (Unable to bind on an Active Directory server using 'domain\userid').

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Fri Jan 20 14:28:59 2012
@@ -1175,7 +1175,7 @@ public class LdapCoreSessionConnection i
     public void anonymousBind() throws LdapException, IOException
     {
         BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( Dn.EMPTY_DN );
+        bindRequest.setName( "" );
         bindRequest.setCredentials( ( byte[] ) null );
 
         BindResponse bindResponse = bind( bindRequest );
@@ -1200,7 +1200,7 @@ public class LdapCoreSessionConnection i
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( bindRequest.getCredentials() );
-        bindContext.setDn( bindRequest.getName() );
+        bindContext.setDn( bindRequest.getDn() );
         bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND
) );
 
         OperationManager operationManager = directoryService.getOperationManager();
@@ -1240,7 +1240,7 @@ public class LdapCoreSessionConnection i
         byte[] credBytes = StringConstants.EMPTY_BYTES;
 
         BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( name );
+        bindRequest.setDn( name );
         bindRequest.setCredentials( credBytes );
 
         BindResponse bindResponse = bind( bindRequest );
@@ -1257,7 +1257,7 @@ public class LdapCoreSessionConnection i
         byte[] credBytes = ( credentials == null ? StringConstants.EMPTY_BYTES : Strings.getBytesUtf8(credentials)
);
 
         BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( name );
+        bindRequest.setDn( name );
         bindRequest.setCredentials( credBytes );
 
         BindResponse bindResponse = bind( bindRequest );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
Fri Jan 20 14:28:59 2012
@@ -242,7 +242,7 @@ public class PasswordPolicyTest extends 
         assertNull( respCtrl );
 
         BindRequest bindReq = new BindRequestImpl();
-        bindReq.setName( userDn );
+        bindReq.setDn( userDn );
         bindReq.setCredentials( "1234" ); // wrong password
         bindReq.addControl( PP_REQ_CTRL );
         
@@ -261,7 +261,7 @@ public class PasswordPolicyTest extends 
         assertEquals( "000001010000Z", pwdAccountLockedTime.getString() );
         
         bindReq = new BindRequestImpl();
-        bindReq.setName( userDn );
+        bindReq.setDn( userDn );
         bindReq.setCredentials( "12345" ); // correct password
         bindReq.addControl( PP_REQ_CTRL );
         userConnection.bind( bindReq );
@@ -461,7 +461,7 @@ public class PasswordPolicyTest extends 
         connection.add( addRequest );
 
         BindRequest bindReq = new BindRequestImpl();
-        bindReq.setName( userDn );
+        bindReq.setDn( userDn );
         bindReq.setCredentials( password.getBytes() );
         bindReq.addControl( PP_REQ_CTRL );
         

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Fri Jan 20 14:28:59 2012
@@ -130,7 +130,7 @@ public class SimpleBindRequestTest exten
         for ( ; i < nbLoop; i++ )
         {
             BindRequest bindRequest = new BindRequestImpl();
-            bindRequest.setName( new Dn( "uid=admin,ou=system" ) );
+            bindRequest.setDn( new Dn( "uid=admin,ou=system" ) );
             bindRequest.setCredentials( "secret" );
 
             BindFuture bindFuture = connection.bindAsync( bindRequest );
@@ -151,7 +151,7 @@ public class SimpleBindRequestTest exten
     public void testSimpleBindRequest() throws Exception
     {
         BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( new Dn( "uid=admin,ou=system" ) );
+        bindRequest.setDn( new Dn( "uid=admin,ou=system" ) );
         bindRequest.setCredentials( "secret" );
 
         BindResponse bindResponse = connection.bind( bindRequest );
@@ -409,7 +409,7 @@ public class SimpleBindRequestTest exten
     public void testDoubleSimpleBindValid() throws Exception
     {
         BindRequest br1 = new BindRequestImpl();
-        br1.setName( new Dn( "uid=admin,ou=system" ) );
+        br1.setDn( new Dn( "uid=admin,ou=system" ) );
         br1.setCredentials( Strings.getBytesUtf8( "secret" ) );
 
         BindResponse response1 = connection.bind( br1 );
@@ -418,7 +418,7 @@ public class SimpleBindRequestTest exten
 
         // The messageId must have been incremented
         BindRequest br2 = new BindRequestImpl();
-        br2.setName( new Dn( "uid=admin,ou=system" ) );
+        br2.setDn( new Dn( "uid=admin,ou=system" ) );
         br2.setCredentials( Strings.getBytesUtf8( "secret" ) );
 
         BindResponse response2 = connection.bind( br2 );
@@ -434,7 +434,7 @@ public class SimpleBindRequestTest exten
 
         // And Bind again. The messageId should be 1 
         BindRequest br3 = new BindRequestImpl();
-        br3.setName( new Dn( "uid=admin,ou=system" ) );
+        br3.setDn( new Dn( "uid=admin,ou=system" ) );
         br3.setCredentials( Strings.getBytesUtf8( "secret" ) );
 
         BindResponse response3 = connection.bind( br3 );
@@ -479,7 +479,7 @@ public class SimpleBindRequestTest exten
 
             // Send another BindRequest
             BindRequest bindRequest = new BindRequestImpl();
-            bindRequest.setName( new Dn( "uid=admin,ou=system" ) );
+            bindRequest.setDn( new Dn( "uid=admin,ou=system" ) );
             bindRequest.setCredentials( "secret" );
 
             BindFuture bindFuture = connection.bindAsync( bindRequest );

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=1233926&r1=1233925&r2=1233926&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 Jan 20 14:28:59 2012
@@ -109,7 +109,7 @@ public class BindHandler extends LdapReq
         BindOperationContext bindContext = new BindOperationContext( null );
 
         // Stores the Dn of the user to check, and its password
-        bindContext.setDn( bindRequest.getName() );
+        bindContext.setDn( bindRequest.getDn() );
         bindContext.setCredentials( bindRequest.getCredentials() );
         bindContext.setIoSession( ldapSession.getIoSession() );
         bindContext.setInterceptors( ldapServer.getDirectoryService().getInterceptors( OperationEnum.BIND
) );
@@ -140,7 +140,7 @@ public class BindHandler extends LdapReq
 
             try
             {
-                principalEntry = getLdapServer().getDirectoryService().getAdminSession().lookup(
bindRequest.getName() );
+                principalEntry = getLdapServer().getDirectoryService().getAdminSession().lookup(
bindRequest.getDn() );
             }
             catch ( LdapException le )
             {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
Fri Jan 20 14:28:59 2012
@@ -59,7 +59,7 @@ public class SimpleMechanismHandler impl
         BindOperationContext bindContext = new BindOperationContext( null );
         
         // Stores the Dn of the user to check, and its password
-        bindContext.setDn( bindRequest.getName() );
+        bindContext.setDn( bindRequest.getDn() );
         bindContext.setCredentials( bindRequest.getCredentials() );
         bindContext.setInterceptors( ldapSession.getLdapServer().getDirectoryService().getInterceptors(
OperationEnum.BIND ) );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
Fri Jan 20 14:28:59 2012
@@ -156,7 +156,7 @@ public class NtlmSaslServer extends Abst
                 try
                 {
                     result = provider.authenticate( getLdapSession().getIoSession(), response
);
-                    Dn dn = getBindRequest().getName();
+                    Dn dn = getBindRequest().getDn();
                     dn.apply( getLdapSession().getLdapServer().getDirectoryService().getSchemaManager()
);
                     LdapPrincipal ldapPrincipal = new LdapPrincipal( getAdminSession().getDirectoryService().getSchemaManager(),

                         dn, AuthenticationLevel.STRONG );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Fri Jan 20 14:28:59 2012
@@ -240,7 +240,7 @@ public class SaslBindIT extends Abstract
         LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort()
);
         BindRequest bindReq = new BindRequestImpl();
         bindReq.setCredentials( "secret" );
-        bindReq.setName( userDn );
+        bindReq.setDn( userDn );
         bindReq.setSaslMechanism( SupportedSaslMechanisms.PLAIN );
 
         BindResponse resp = connection.bind( bindReq );
@@ -264,7 +264,7 @@ public class SaslBindIT extends Abstract
         LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort()
);
         BindRequest bindReq = new BindRequestImpl();
         bindReq.setCredentials( "secret" );
-        bindReq.setName( userDn );
+        bindReq.setDn( userDn );
         bindReq.setSaslMechanism( "" ); // invalid mechanism
         bindReq.setSimple( false );
 
@@ -688,7 +688,7 @@ public class SaslBindIT extends Abstract
             // Setup the bind request
             BindRequestImpl request = new BindRequestImpl();
             request.setMessageId( 1 );
-            request.setName( new Dn( "uid=admin,ou=system" ) );
+            request.setDn( new Dn( "uid=admin,ou=system" ) );
             request.setSimple( false );
             request.setCredentials( type1response );
             request.setSaslMechanism( mechanism );
@@ -728,7 +728,7 @@ public class SaslBindIT extends Abstract
             // Setup the bind request
             BindRequestImpl request = new BindRequestImpl();
             request.setMessageId( 2 );
-            request.setName( new Dn( "uid=admin,ou=system" ) );
+            request.setDn( new Dn( "uid=admin,ou=system" ) );
             request.setSimple( false );
             request.setCredentials( type3response );
             request.setSaslMechanism( mechanism );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java?rev=1233926&r1=1233925&r2=1233926&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
Fri Jan 20 14:28:59 2012
@@ -212,7 +212,7 @@ public class SimpleBindIT extends Abstra
         catch ( InvalidNameException ine )
         {
             // Error code 34 : LDAP_INVALID_DN_SYNTAX
-            assertTrue( ine.getMessage().startsWith( "[LDAP: error code 34 - Incorrect Dn
given" ) );
+            assertTrue( ine.getMessage().startsWith( "[LDAP: error code 34 - Incorrect DN
given" ) );
         }
         catch ( NamingException e )
         {



Mime
View raw message