mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added RPCRegisterPort configuration value, and nfs.rpcRegisterPort property.
Defaults to zero to use next free unprivileged port when registering the NFS/mount servers with the portmapper. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19376 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -260,6 +260,11 @@
|
||||
<value>${nfs.portMapperPort}</value>
|
||||
</property>
|
||||
|
||||
<!-- RPC registration port -->
|
||||
<property name="rpcRegisterPort">
|
||||
<value>${nfs.rpcRegisterPort}</value>
|
||||
</property>
|
||||
|
||||
<!-- Enable/disable the builtin portMapper service -->
|
||||
<property name="portMapperEnabled">
|
||||
<value>${nfs.portMapperEnabled}</value>
|
||||
|
@@ -57,6 +57,10 @@ nfs.enabled=false
|
||||
nfs.mountServerPort=0
|
||||
nfs.nfsServerPort=2049
|
||||
|
||||
# RPC registration port, 0 will allocate next available port
|
||||
# Some portmapper/rpcbind services require a privileged port to be used
|
||||
nfs.rpcRegisterPort=0
|
||||
|
||||
# To disable NFS and mount server registering with a portmapper set nfs.portMapperPort to -1
|
||||
nfs.portMapperPort=111
|
||||
# Enable the builtin portmapper service
|
||||
|
@@ -1730,6 +1730,20 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean {
|
||||
}
|
||||
}
|
||||
|
||||
// Check for an RPC registration port
|
||||
|
||||
elem = config.getConfigElement("RPCRegisterPort");
|
||||
if ( elem != null) {
|
||||
try {
|
||||
nfsConfig.setRPCRegistrationPort( Integer.parseInt(elem.getValue()));
|
||||
if ( nfsConfig.getRPCRegistrationPort() <= 0 || nfsConfig.getRPCRegistrationPort() >= 65535)
|
||||
throw new AlfrescoRuntimeException("RPC registration port out of valid range");
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new AlfrescoRuntimeException("Invalid RPC registration port");
|
||||
}
|
||||
}
|
||||
|
||||
// Check if NFS debug is enabled
|
||||
|
||||
elem = config.getConfigElement("debug");
|
||||
|
@@ -62,6 +62,9 @@ public class NFSConfigBean
|
||||
/** The rpc authenticator. */
|
||||
private RpcAuthenticator rpcAuthenticator;
|
||||
|
||||
/** RPC register port */
|
||||
private Integer rpcRegisterPort;
|
||||
|
||||
/**
|
||||
* Checks if is server enabled.
|
||||
*
|
||||
@@ -293,4 +296,23 @@ public class NFSConfigBean
|
||||
this.rpcAuthenticator = rpcAuthenticator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the RPC registration port
|
||||
*
|
||||
* @param rpcRegPort Integer
|
||||
*/
|
||||
public void setRpcRegisterPort(Integer rpcRegPort)
|
||||
{
|
||||
this.rpcRegisterPort = rpcRegPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the RPC register port
|
||||
*
|
||||
* @return Integer
|
||||
*/
|
||||
public Integer getRpcRegisterPort()
|
||||
{
|
||||
return rpcRegisterPort;
|
||||
}
|
||||
}
|
||||
|
@@ -1441,6 +1441,16 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean
|
||||
throw new AlfrescoRuntimeException("NFS server port out of valid range");
|
||||
}
|
||||
|
||||
// Check for an RPC registration port
|
||||
|
||||
Integer rpcRegisterPort = nfsConfigBean.getRpcRegisterPort();
|
||||
if ( rpcRegisterPort != null)
|
||||
{
|
||||
nfsConfig.setRPCRegistrationPort( rpcRegisterPort);
|
||||
if ( nfsConfig.getRPCRegistrationPort() < 0 || nfsConfig.getRPCRegistrationPort() >= 65535)
|
||||
throw new AlfrescoRuntimeException("RPC registrtion port out of valid range");
|
||||
}
|
||||
|
||||
// Check for NFS debug flags
|
||||
|
||||
String flags = nfsConfigBean.getDebugFlags();
|
||||
|
Reference in New Issue
Block a user