Add config option securePermissionsLoading which will stop the region from loading if the specified permissions modules fail to load.

avinationmerge
Tom Grimshaw 2010-07-22 10:46:57 -07:00
parent 6f591376dd
commit 9ce2f95f37
2 changed files with 24 additions and 0 deletions

View File

@ -91,6 +91,10 @@ namespace OpenSim
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
private List<string> m_permsModules;
private bool m_securePermissionsLoading = true;
/// <value> /// <value>
/// The config information passed into the OpenSimulator region server. /// The config information passed into the OpenSimulator region server.
/// </value> /// </value>
@ -188,6 +192,11 @@ namespace OpenSim
CreatePIDFile(pidFile); CreatePIDFile(pidFile);
userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
m_permsModules = new List<string>(permissionModules.Split(','));
} }
base.StartupSpecific(); base.StartupSpecific();
@ -345,6 +354,18 @@ namespace OpenSim
} }
else m_log.Error("[MODULES]: The new RegionModulesController is missing..."); else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
if (m_securePermissionsLoading)
{
foreach (string s in m_permsModules)
{
if (!scene.RegionModules.ContainsKey(s))
{
m_log.Fatal("[MODULES]: Required module " + s + " not found.");
Environment.Exit(0);
}
}
}
scene.SetModuleInterfaces(); scene.SetModuleInterfaces();
// First Step of bootreport sequence // First Step of bootreport sequence
if (scene.SnmpService != null) if (scene.SnmpService != null)

View File

@ -202,6 +202,9 @@
;permissionmodules = "DefaultPermissionsModule" ;permissionmodules = "DefaultPermissionsModule"
;If any of the specified permissions modules fail to load, quit?
SecurePermissionsLoading = true
; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy ; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy
; any item, etc. This may not yet be implemented uniformally. ; any item, etc. This may not yet be implemented uniformally.
; If set to true, then all permissions checks are carried out ; If set to true, then all permissions checks are carried out