From 92c73dd54a521aac6cc4c0e923e8b67162ec0186 Mon Sep 17 00:00:00 2001 From: Gary Spencer Date: Tue, 6 Feb 2007 10:29:31 +0000 Subject: [PATCH] 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 --- .../filesys/server/config/ServerConfiguration.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java b/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java index 67231314e1..2254d918e6 100644 --- a/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java +++ b/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java @@ -823,6 +823,20 @@ public class ServerConfiguration extends AbstractLifecycleBean 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 setServerName(hostName.toUpperCase());