From 3af879b55e05be54efe40516bed1d544f177c3ac Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 14 Mar 2014 16:27:05 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 63637: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (4.3.0.BF) 63563: MNT-10384: Merged DEV to V4.2-BUG-FIX (4.2.2) 63550: MNT-10384: when using CIFS on windows, alfresco should raise an error is the cifs.name is the windows server name - Throw AlfrescoRuntimeException if the cifs.name is the windows server name git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64301 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../config/ServerConfigurationBean.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java b/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java index 4a33a4b945..019a311974 100644 --- a/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java +++ b/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java @@ -250,16 +250,15 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp throw new AlfrescoRuntimeException("CIFS Host name not specified or invalid"); } + // Get the local server name + + String srvName = getLocalServerName(true); + // Check if the host name contains the local name token int pos = hostName.indexOf(TokenLocalName); if (pos != -1) { - - // Get the local server name - - String srvName = getLocalServerName(true); - // Rebuild the host name substituting the token with the local server name StringBuilder hostStr = new StringBuilder(); @@ -274,14 +273,13 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp } hostName = hostStr.toString(); + } - // Make sure the CIFS server name does not match the local server name + // Make sure the CIFS server name does not match the local server name - if (hostName.equals(srvName) && getPlatformType() == Platform.Type.WINDOWS) - { - throw new AlfrescoRuntimeException("CIFS server name must be unique"); - - } + if (hostName.toUpperCase().equals(srvName.toUpperCase()) && getPlatformType() == Platform.Type.WINDOWS) + { + throw new AlfrescoRuntimeException("CIFS server name must be unique"); } // Check if the host name is longer than 15 characters. NetBIOS only allows a maximum of 16 characters in