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
This commit is contained in:
Alan Davis
2014-03-14 16:27:05 +00:00
parent 985734be08
commit 3af879b55e

View File

@@ -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