mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge 3.1 to HEAD:
13314: Fix for CIFS offline sync, reconnect updated file to properties/history. ETHREEOH-1247. 13334: Added attribute to allow CIFS host announcement to be switched off via custom config. ETHREEOH-1356. Fixed bug in Windows domain name config. 13335: Changed error message to warning, and removed stacktrace, when resolving the server name. 13336: Renamed file-servers-custom.xml out of the way, to .sample2. Seems to be from an Adobe merge. 13377: Hack to enable basic CIFS IPv6 support, enabled via <tcpipSMB ipv6="enabled"/> in the xml config file. 13399: Fixed confusing debug message. 13431: Added missing parsing of 'offlineCheckInterval' parameter. 13457: Added support for file locking on in-memory pseudo files. Fix for problem with __AlfrescoClient.url files ETHREEOH-1311 13485: Added the missing CIFS sessionTimeout config value parsing. 13521: Updated file-servers.xml default config to match previous file-servers-custom.xml settings git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13762 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -192,6 +192,10 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
private static final int MemoryPoolMinimumAllocation = 5;
|
||||
private static final int MemoryPoolMaximumAllocation = 500;
|
||||
|
||||
// Maximum session timeout
|
||||
|
||||
private static final int MaxSessionTimeout = 60 * 60; // 1 hour
|
||||
|
||||
// Authentication manager
|
||||
|
||||
private AuthenticationManager m_authenticationManager;
|
||||
@@ -935,31 +939,46 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
elem = config.getConfigElement("hostAnnounce");
|
||||
if (elem != null)
|
||||
{
|
||||
|
||||
// Check for an announcement interval
|
||||
|
||||
String interval = elem.getAttribute("interval");
|
||||
if (interval != null && interval.length() > 0)
|
||||
// Check if the host announcer has been disabled
|
||||
|
||||
String enabled = elem.getAttribute("enabled");
|
||||
if ( enabled != null && enabled.equalsIgnoreCase( "false"))
|
||||
{
|
||||
try
|
||||
{
|
||||
cifsConfig.setHostAnnounceInterval(Integer.parseInt(interval));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid host announcement interval");
|
||||
}
|
||||
// Switch off the host announcer
|
||||
|
||||
cifsConfig.setHostAnnouncer( false);
|
||||
|
||||
// Log that host announcements are not enabled
|
||||
|
||||
logger.info("Host announcements not enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for an announcement interval
|
||||
|
||||
String interval = elem.getAttribute("interval");
|
||||
if (interval != null && interval.length() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
cifsConfig.setHostAnnounceInterval(Integer.parseInt(interval));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid host announcement interval");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the domain name has been set, this is required if the
|
||||
// host announcer is enabled
|
||||
|
||||
if (cifsConfig.getDomainName() == null)
|
||||
throw new AlfrescoRuntimeException("Domain name must be specified if host announcement is enabled");
|
||||
|
||||
// Enable host announcement
|
||||
|
||||
cifsConfig.setHostAnnouncer(true);
|
||||
}
|
||||
|
||||
// Check if the domain name has been set, this is required if the
|
||||
// host announcer is enabled
|
||||
|
||||
if (cifsConfig.getDomainName() == null)
|
||||
throw new AlfrescoRuntimeException("Domain name must be specified if host announcement is enabled");
|
||||
|
||||
// Enable host announcement
|
||||
|
||||
cifsConfig.setHostAnnouncer(true);
|
||||
}
|
||||
|
||||
// Check if NetBIOS SMB is enabled
|
||||
@@ -1260,19 +1279,41 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
|
||||
cifsConfig.setTcpipSMB(platformOK);
|
||||
|
||||
// Check if the port has been specified
|
||||
// Check if the port has been specified
|
||||
|
||||
String portNum = elem.getAttribute("port");
|
||||
if ( portNum != null && portNum.length() > 0) {
|
||||
try {
|
||||
cifsConfig.setTcpipSMBPort(Integer.parseInt(portNum));
|
||||
if ( cifsConfig.getTcpipSMBPort() <= 0 || cifsConfig.getTcpipSMBPort() >= 65535)
|
||||
throw new AlfrescoRuntimeException("TCP/IP SMB port out of valid range");
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new AlfrescoRuntimeException("Invalid TCP/IP SMB port");
|
||||
}
|
||||
}
|
||||
String portNum = elem.getAttribute("port");
|
||||
if ( portNum != null && portNum.length() > 0) {
|
||||
try {
|
||||
cifsConfig.setTcpipSMBPort(Integer.parseInt(portNum));
|
||||
if ( cifsConfig.getTcpipSMBPort() <= 0 || cifsConfig.getTcpipSMBPort() >= 65535)
|
||||
throw new AlfrescoRuntimeException("TCP/IP SMB port out of valid range");
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new AlfrescoRuntimeException("Invalid TCP/IP SMB port");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if IPv6 support should be enabled
|
||||
|
||||
String ipv6 = elem.getAttribute("ipv6");
|
||||
if ( ipv6 != null && ipv6.equalsIgnoreCase( "enabled"))
|
||||
{
|
||||
try
|
||||
{
|
||||
// Use the IPv6 bind all address
|
||||
|
||||
cifsConfig.setSMBBindAddress( InetAddress.getByName( "::"));
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( logger.isInfoEnabled())
|
||||
logger.info("Enabled CIFS IPv6 bind address for native SMB");
|
||||
}
|
||||
catch ( UnknownHostException ex)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to enable IPv6 bind address, " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1428,31 +1469,46 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
elem = config.getConfigElement("Win32Announce");
|
||||
if (elem != null)
|
||||
{
|
||||
|
||||
// Check for an announcement interval
|
||||
|
||||
String interval = elem.getAttribute("interval");
|
||||
if (interval != null && interval.length() > 0)
|
||||
// Check if the Win32 host announcer has been disabled
|
||||
|
||||
String enabled = elem.getAttribute("enabled");
|
||||
if ( enabled != null && enabled.equalsIgnoreCase( "false"))
|
||||
{
|
||||
try
|
||||
{
|
||||
cifsConfig.setWin32HostAnnounceInterval(Integer.parseInt(interval));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid host announcement interval");
|
||||
}
|
||||
// Switch off the Win32 host announcer
|
||||
|
||||
cifsConfig.setWin32HostAnnouncer( false);
|
||||
|
||||
// Log that host announcements are not enabled
|
||||
|
||||
logger.info("Win32 host announcements not enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for an announcement interval
|
||||
|
||||
String interval = elem.getAttribute("interval");
|
||||
if (interval != null && interval.length() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
cifsConfig.setWin32HostAnnounceInterval(Integer.parseInt(interval));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid host announcement interval");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the domain name has been set, this is required if the
|
||||
// host announcer is enabled
|
||||
|
||||
if (cifsConfig.getDomainName() == null)
|
||||
throw new AlfrescoRuntimeException("Domain name must be specified if host announcement is enabled");
|
||||
|
||||
// Enable Win32 NetBIOS host announcement
|
||||
|
||||
cifsConfig.setWin32HostAnnouncer(true);
|
||||
}
|
||||
|
||||
// Check if the domain name has been set, this is required if the
|
||||
// host announcer is enabled
|
||||
|
||||
if (cifsConfig.getDomainName() == null)
|
||||
throw new AlfrescoRuntimeException("Domain name must be specified if host announcement is enabled");
|
||||
|
||||
// Enable Win32 NetBIOS host announcement
|
||||
|
||||
cifsConfig.setWin32HostAnnouncer(true);
|
||||
}
|
||||
|
||||
// Check if NetBIOS and/or TCP/IP SMB have been enabled
|
||||
@@ -1626,6 +1682,35 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
if ( logger.isDebugEnabled())
|
||||
logger.debug("NIO based code disabled for CIFS server");
|
||||
}
|
||||
|
||||
// Check if a session timeout is configured
|
||||
|
||||
elem = config.getConfigElement("sessionTimeout");
|
||||
if ( elem != null) {
|
||||
|
||||
// Validate the session timeout value
|
||||
|
||||
String sessTmo = elem.getValue();
|
||||
if ( sessTmo != null && sessTmo.length() > 0) {
|
||||
try {
|
||||
|
||||
// Convert the timeout value to milliseconds
|
||||
|
||||
int tmo = Integer.parseInt(sessTmo);
|
||||
if ( tmo < 0 || tmo > MaxSessionTimeout)
|
||||
throw new AlfrescoRuntimeException("Session timeout out of range (0 - " + MaxSessionTimeout + ")");
|
||||
|
||||
// Convert the session timeout to milliseconds
|
||||
|
||||
cifsConfig.setSocketTimeout( tmo * 1000);
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new AlfrescoRuntimeException("Invalid session timeout value, " + sessTmo);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new AlfrescoRuntimeException("Session timeout value not specified");
|
||||
}
|
||||
}
|
||||
catch ( InvalidConfigurationException ex)
|
||||
{
|
||||
@@ -3044,7 +3129,7 @@ public class ServerConfigurationBean extends ServerConfiguration implements Appl
|
||||
|
||||
String domainName = null;
|
||||
|
||||
if (getPlatformType() == Platform.Type.WINDOWS && isNativeCodeDisabled())
|
||||
if (getPlatformType() == Platform.Type.WINDOWS && isNativeCodeDisabled() == false)
|
||||
{
|
||||
// Get the local domain/workgroup name via JNI
|
||||
|
||||
|
Reference in New Issue
Block a user