diff --git a/config/alfresco/authentication-services-context.xml b/config/alfresco/authentication-services-context.xml
index 6a5c4fb0ca..fe8bfc971a 100644
--- a/config/alfresco/authentication-services-context.xml
+++ b/config/alfresco/authentication-services-context.xml
@@ -255,12 +255,8 @@
${server.transaction.allow-writes}
-
-
-
-
-
- ${user.name.caseSensitive}
+
+ ${user.name.caseSensitive}
diff --git a/config/alfresco/public-services-security-context.xml b/config/alfresco/public-services-security-context.xml
index 0081b9874c..27268967be 100644
--- a/config/alfresco/public-services-security-context.xml
+++ b/config/alfresco/public-services-security-context.xml
@@ -684,7 +684,6 @@
org.alfresco.service.cmr.security.PersonService.deletePerson=ACL_METHOD.ROLE_ADMINISTRATOR
org.alfresco.service.cmr.security.PersonService.getAllPeople=ACL_ALLOW
org.alfresco.service.cmr.security.PersonService.getPeopleContainer=ACL_ALLOW
- org.alfresco.service.cmr.security.PersonService.getUserNamesAreCaseSensitive=ACL_ALLOW
diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties
index 736fe5d4ee..47d1746087 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -105,6 +105,16 @@ system.system_container.childname=sys:system
system.people_container.childname=sys:people
# Are user names case sensitive?
+# ==============================
+#
+# NOTE: If you are using mysql you must have case sensitive collation
+#
+# You can do this when creating the alfresco database at the start
+# CREATE DATABASE alfresco CHARACTER SET utf8 COLLATION utf8_bin;
+# If you want to do this later this is a dump and load fix as it is dome when the database, tables and columns are created.
+#
+# Must other databases are case sensitive by default.
+#
user.name.caseSensitive=false
diff --git a/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java
index 9a65f8fea6..5b77d4171d 100644
--- a/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java
+++ b/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java
@@ -20,6 +20,7 @@ import java.security.NoSuchAlgorithmException;
import net.sf.acegisecurity.Authentication;
import org.alfresco.filesys.server.SrvSession;
+import org.alfresco.filesys.server.auth.AuthContext;
import org.alfresco.filesys.server.auth.CifsAuthenticator;
import org.alfresco.filesys.server.auth.ClientInfo;
import org.alfresco.filesys.server.auth.NTLanManAuthContext;
@@ -182,26 +183,22 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
}
/**
- * Generate a challenge key
+ * Return an authentication context for the new session
*
- * @param sess SrvSession
- * @return byte[]
+ * @return AuthContext
*/
- public byte[] getChallengeKey(SrvSession sess)
+ public AuthContext getAuthContext( SMBSrvSession sess)
{
- // In MD4 mode we generate the challenge locally
-
- byte[] key = null;
-
// Check if the client is already authenticated, and it is not a null logon
-
+
+ AuthContext authCtx = null;
+
if ( sess.hasAuthenticationContext() && sess.hasAuthenticationToken() &&
sess.getClientInformation().getLogonType() != ClientInfo.LogonNull)
{
// Return the previous challenge, user is already authenticated
- NTLanManAuthContext authCtx = (NTLanManAuthContext) sess.getAuthenticationContext();
- key = authCtx.getChallenge();
+ authCtx = (NTLanManAuthContext) sess.getAuthenticationContext();
// DEBUG
@@ -210,11 +207,10 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
}
else if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
{
- // Generate a new challenge key, pack the key and return
-
- key = new byte[8];
-
- DataPacker.putIntelLong(m_random.nextLong(), key, 0);
+ // Create a new authentication context for the session
+
+ authCtx = new NTLanManAuthContext();
+ sess.setAuthenticationContext( authCtx);
}
else
{
@@ -233,14 +229,17 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
// Get the challenge from the token
if ( authToken.getChallenge() != null)
- key = authToken.getChallenge().getBytes();
+ {
+ authCtx = new NTLanManAuthContext( authToken.getChallenge().getBytes());
+ sess.setAuthenticationContext( authCtx);
+ }
}
- // Return the challenge
+ // Return the authentication context
- return key;
+ return authCtx;
}
-
+
/**
* Perform MD4 user authentication
*
diff --git a/source/java/org/alfresco/filesys/server/auth/passthru/PassthruAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/passthru/PassthruAuthenticator.java
index 634c464b77..b2a83d1454 100644
--- a/source/java/org/alfresco/filesys/server/auth/passthru/PassthruAuthenticator.java
+++ b/source/java/org/alfresco/filesys/server/auth/passthru/PassthruAuthenticator.java
@@ -236,10 +236,8 @@ public class PassthruAuthenticator extends CifsAuthenticator implements SessionL
}
else
{
- // Set using the user name, lowercase the name if the person service is case insensitive
+ // Set using the user name
- if ( m_personService.getUserNamesAreCaseSensitive() == false)
- username = username.toLowerCase();
m_authComponent.setCurrentUser( username);
// DEBUG
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java b/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
index 0d57ee05c3..45ea54225e 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
@@ -19,7 +19,9 @@ package org.alfresco.filesys.smb.server.repo;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.List;
import javax.transaction.UserTransaction;
@@ -352,7 +354,22 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
URL appURL = this.getClass().getClassLoader().getResource(appPath.getValue());
if ( appURL == null)
throw new DeviceContextException("Failed to find drag and drop application, " + appPath.getValue());
- File appFile = new File(appURL.getFile());
+
+ // Decode the URL path, it might contain escaped characters
+
+ String appURLPath = null;
+ try
+ {
+ appURLPath = URLDecoder.decode( appURL.getFile(), "UTF-8");
+ }
+ catch ( UnsupportedEncodingException ex)
+ {
+ throw new DeviceContextException("Failed to decode drag/drop path, " + ex.getMessage());
+ }
+
+ // Check that the drag/drop file exists
+
+ File appFile = new File(appURLPath);
if ( appFile.exists() == false)
throw new DeviceContextException("Drag and drop application not found, " + appPath.getValue());
diff --git a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImplTest.java b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImplTest.java
index e9b02fada2..c8f4edc937 100644
--- a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImplTest.java
+++ b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImplTest.java
@@ -146,8 +146,8 @@ public class CheckOutCheckInServiceImplTest extends BaseSpringTest
TestWithUserUtils.authenticateUser(this.userName, PWD, this.rootNodeRef, this.authenticationService);
this.userNodeRef = TestWithUserUtils.getCurrentUser(this.authenticationService);
- permissionService.setPermission(this.rootNodeRef, this.userName.toLowerCase(), PermissionService.ALL_PERMISSIONS, true);
- permissionService.setPermission(this.nodeRef, this.userName.toLowerCase(), PermissionService.ALL_PERMISSIONS, true);
+ permissionService.setPermission(this.rootNodeRef, this.userName, PermissionService.ALL_PERMISSIONS, true);
+ permissionService.setPermission(this.nodeRef, this.userName, PermissionService.ALL_PERMISSIONS, true);
}
/**
diff --git a/source/java/org/alfresco/repo/descriptor/DescriptorServiceImpl.java b/source/java/org/alfresco/repo/descriptor/DescriptorServiceImpl.java
index 92aa77577b..833885bda5 100644
--- a/source/java/org/alfresco/repo/descriptor/DescriptorServiceImpl.java
+++ b/source/java/org/alfresco/repo/descriptor/DescriptorServiceImpl.java
@@ -44,6 +44,7 @@ import org.alfresco.service.transaction.TransactionService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
@@ -58,7 +59,7 @@ import org.springframework.core.io.Resource;
*
* @author David Caruana
*/
-public class DescriptorServiceImpl implements DescriptorService, ApplicationListener, InitializingBean, ApplicationContextAware
+public class DescriptorServiceImpl implements DescriptorService, ApplicationListener, InitializingBean, ApplicationContextAware, DisposableBean
{
private static Log logger = LogFactory.getLog(DescriptorServiceImpl.class);
@@ -201,6 +202,13 @@ public class DescriptorServiceImpl implements DescriptorService, ApplicationList
serverDescriptor = createServerDescriptor();
}
+ /**
+ * Destruction hook
+ */
+ public void destroy() throws Exception
+ {
+ }
+
/**
* Create server descriptor
*
@@ -710,5 +718,4 @@ public class DescriptorServiceImpl implements DescriptorService, ApplicationList
return serverProperties.getProperty(key, "");
}
}
-
}
diff --git a/source/java/org/alfresco/repo/domain/hibernate/ChildAssocImpl.java b/source/java/org/alfresco/repo/domain/hibernate/ChildAssocImpl.java
index d0acb65339..85cd40e019 100644
--- a/source/java/org/alfresco/repo/domain/hibernate/ChildAssocImpl.java
+++ b/source/java/org/alfresco/repo/domain/hibernate/ChildAssocImpl.java
@@ -149,12 +149,19 @@ public class ChildAssocImpl implements ChildAssoc, Serializable
return false;
}
ChildAssoc that = (ChildAssoc) obj;
- return (
- EqualsHelper.nullSafeEquals(this.getTypeQName(), that.getTypeQName())
- && EqualsHelper.nullSafeEquals(this.getQname(), that.getQname())
- && EqualsHelper.nullSafeEquals(this.getParent(), that.getParent())
- && EqualsHelper.nullSafeEquals(this.getChild(), that.getChild())
- );
+ if (EqualsHelper.nullSafeEquals(id, that.getId()))
+ {
+ return true;
+ }
+ else
+ {
+ return (
+ EqualsHelper.nullSafeEquals(this.getChild().getId(), that.getChild().getId())
+ && EqualsHelper.nullSafeEquals(this.getQname(), that.getQname())
+ && EqualsHelper.nullSafeEquals(this.getParent().getId(), that.getParent().getId())
+ && EqualsHelper.nullSafeEquals(this.getTypeQName(), that.getTypeQName())
+ );
+ }
}
public int hashCode()
diff --git a/source/java/org/alfresco/repo/domain/hibernate/DbAccessControlEntryImpl.java b/source/java/org/alfresco/repo/domain/hibernate/DbAccessControlEntryImpl.java
index db1032aa6d..32da2216e1 100644
--- a/source/java/org/alfresco/repo/domain/hibernate/DbAccessControlEntryImpl.java
+++ b/source/java/org/alfresco/repo/domain/hibernate/DbAccessControlEntryImpl.java
@@ -79,8 +79,15 @@ public class DbAccessControlEntryImpl extends LifecycleAdapter
return false;
}
DbAccessControlEntry other = (DbAccessControlEntry) o;
- return (EqualsHelper.nullSafeEquals(this.permission, other.getPermission())
- && EqualsHelper.nullSafeEquals(this.authority, other.getAuthority()));
+ if (EqualsHelper.nullSafeEquals(id, other.getId()))
+ {
+ return true;
+ }
+ else
+ {
+ return (EqualsHelper.nullSafeEquals(this.permission, other.getPermission())
+ && EqualsHelper.nullSafeEquals(this.authority, other.getAuthority()));
+ }
}
@Override
diff --git a/source/java/org/alfresco/repo/domain/hibernate/NodeImpl.java b/source/java/org/alfresco/repo/domain/hibernate/NodeImpl.java
index 40aa060edd..1e505c347d 100644
--- a/source/java/org/alfresco/repo/domain/hibernate/NodeImpl.java
+++ b/source/java/org/alfresco/repo/domain/hibernate/NodeImpl.java
@@ -137,8 +137,14 @@ public class NodeImpl extends LifecycleAdapter implements Node, Serializable
return false;
}
Node that = (Node) obj;
- return (EqualsHelper.nullSafeEquals(getStore(), that.getStore())
- && EqualsHelper.nullSafeEquals(getUuid(), that.getUuid()));
+ if (EqualsHelper.nullSafeEquals(id, that.getId()))
+ {
+ return true;
+ }
+ else
+ {
+ return (this.getNodeRef().equals(that.getNodeRef()));
+ }
}
public int hashCode()
diff --git a/source/java/org/alfresco/repo/lock/LockBehaviourImplTest.java b/source/java/org/alfresco/repo/lock/LockBehaviourImplTest.java
index 81a150cf88..d89401aff7 100644
--- a/source/java/org/alfresco/repo/lock/LockBehaviourImplTest.java
+++ b/source/java/org/alfresco/repo/lock/LockBehaviourImplTest.java
@@ -135,8 +135,8 @@ public class LockBehaviourImplTest extends BaseSpringTest
TestWithUserUtils.authenticateUser(BAD_USER_NAME, PWD, rootNodeRef, this.authenticationService);
TestWithUserUtils.authenticateUser(GOOD_USER_NAME, PWD, rootNodeRef, this.authenticationService);
- permissionService.setPermission(rootNodeRef, GOOD_USER_NAME.toLowerCase(), PermissionService.ALL_PERMISSIONS, true);
- permissionService.setPermission(rootNodeRef, BAD_USER_NAME.toLowerCase(), PermissionService.READ, true);
+ permissionService.setPermission(rootNodeRef, GOOD_USER_NAME, PermissionService.ALL_PERMISSIONS, true);
+ permissionService.setPermission(rootNodeRef, BAD_USER_NAME, PermissionService.READ, true);
}
/**
diff --git a/source/java/org/alfresco/repo/model/filefolder/FileFolderPerformanceTester.java b/source/java/org/alfresco/repo/model/filefolder/FileFolderPerformanceTester.java
index 847a8c7201..e20fced88e 100644
--- a/source/java/org/alfresco/repo/model/filefolder/FileFolderPerformanceTester.java
+++ b/source/java/org/alfresco/repo/model/filefolder/FileFolderPerformanceTester.java
@@ -31,6 +31,7 @@ import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
+import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -236,10 +237,80 @@ public class FileFolderPerformanceTester extends TestCase
}
}
- public void test_2_ordered_1_10() throws Exception
+ private void readStructure(
+ final NodeRef parentNodeRef,
+ final int threadCount,
+ final int repetitions,
+ final double[] dumpPoints)
{
- buildStructure(rootFolderRef, 2, false, 1, 10, null);
+ final List children = nodeService.getChildAssocs(parentNodeRef);
+ Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ // authenticate
+ authenticationComponent.setSystemUserAsCurrentUser();
+
+ for (int i = 0; i < repetitions; i++)
+ {
+ // read the contents of each folder
+ for (ChildAssociationRef childAssociationRef : children)
+ {
+ final NodeRef folderRef = childAssociationRef.getChildRef();
+ TransactionWork