Truncate the CIFS server name is longer than 15 characters and output a warning. Fix for AR-1118.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5046 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2007-02-06 10:29:31 +00:00
parent a864bc072a
commit 92c73dd54a

View File

@@ -823,6 +823,20 @@ public class ServerConfiguration extends AbstractLifecycleBean
throw new AlfrescoRuntimeException("CIFS server name must be unique"); 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 the
// server name with the last character reserved for the service type.
if ( hostName.length() > 15)
{
// Truncate the CIFS server name
hostName = hostName.substring(0, 15);
// Output a warning
logger.warn("CIFS server name is longer than 15 characters, truncated to " + hostName);
}
// Set the CIFS server name // Set the CIFS server name
setServerName(hostName.toUpperCase()); setServerName(hostName.toUpperCase());