From 9ce2f95f37c6234c9750c611106730c65ec6f1f5 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 22 Jul 2010 10:46:57 -0700 Subject: Add config option securePermissionsLoading which will stop the region from loading if the specified permissions modules fail to load. --- OpenSim/Region/Application/OpenSimBase.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 1ec96a0..b21793e 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -91,6 +91,10 @@ namespace OpenSim protected List m_plugins = new List(); + private List m_permsModules; + + private bool m_securePermissionsLoading = true; + /// /// The config information passed into the OpenSimulator region server. /// @@ -188,6 +192,11 @@ namespace OpenSim CreatePIDFile(pidFile); userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); + + m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); + + string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); + m_permsModules = new List(permissionModules.Split(',')); } base.StartupSpecific(); @@ -345,6 +354,18 @@ namespace OpenSim } 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(); // First Step of bootreport sequence if (scene.SnmpService != null) -- cgit v1.1