diff options
author | Justin Clark-Casey (justincc) | 2014-07-21 23:53:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-21 23:53:33 +0100 |
commit | 3c6becd52495360b24b3760a30fb0e007f5a16a3 (patch) | |
tree | 51362e21c3ea699e948e19ee3ce4a37058d1c337 | |
parent | minor: Limit processor related stats to 3 decimal places instead of all the p... (diff) | |
download | opensim-SC_OLD-3c6becd52495360b24b3760a30fb0e007f5a16a3.zip opensim-SC_OLD-3c6becd52495360b24b3760a30fb0e007f5a16a3.tar.gz opensim-SC_OLD-3c6becd52495360b24b3760a30fb0e007f5a16a3.tar.bz2 opensim-SC_OLD-3c6becd52495360b24b3760a30fb0e007f5a16a3.tar.xz |
On login and first HG entrance to a foreign grid, perform query access checks before proceeding.
Diffstat (limited to '')
5 files changed, 35 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index e6de0b6..50105a6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -283,18 +283,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
283 | // s.RegionInfo.RegionName, destination.RegionHandle); | 283 | // s.RegionInfo.RegionName, destination.RegionHandle); |
284 | uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; | 284 | uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; |
285 | 285 | ||
286 | float theirVersionNumber = 0f; | 286 | if (theirversion != null) |
287 | string[] versionComponents = theirversion.Split(new char[] { '/' }); | ||
288 | if (versionComponents.Length >= 2) | ||
289 | float.TryParse(versionComponents[1], out theirVersionNumber); | ||
290 | |||
291 | // Var regions here, and the requesting simulator is in an older version. | ||
292 | // We will forbide this, because it crashes the viewers | ||
293 | if (theirVersionNumber < 0.3f && size > 256) | ||
294 | { | 287 | { |
295 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; | 288 | float theirVersionNumber = 0f; |
296 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); | 289 | string[] versionComponents = theirversion.Split(new char[] { '/' }); |
297 | return false; | 290 | if (versionComponents.Length >= 2) |
291 | float.TryParse(versionComponents[1], out theirVersionNumber); | ||
292 | |||
293 | // Var regions here, and the requesting simulator is in an older version. | ||
294 | // We will forbide this, because it crashes the viewers | ||
295 | if (theirVersionNumber < 0.3f && size > 256) | ||
296 | { | ||
297 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; | ||
298 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); | ||
299 | return false; | ||
300 | |||
301 | } | ||
298 | } | 302 | } |
299 | 303 | ||
300 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); | 304 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 27929c6..4bbe68b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5514,6 +5514,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5514 | 5514 | ||
5515 | int num = m_sceneGraph.GetRootAgentCount(); | 5515 | int num = m_sceneGraph.GetRootAgentCount(); |
5516 | 5516 | ||
5517 | Console.WriteLine("{0} {1}", num, RegionInfo.RegionSettings.AgentLimit); | ||
5517 | if (num >= RegionInfo.RegionSettings.AgentLimit) | 5518 | if (num >= RegionInfo.RegionSettings.AgentLimit) |
5518 | { | 5519 | { |
5519 | if (!Permissions.IsAdministrator(agentID)) | 5520 | if (!Permissions.IsAdministrator(agentID)) |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 69a593b..771114e 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -432,6 +432,13 @@ namespace OpenSim.Services.HypergridService | |||
432 | 432 | ||
433 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); | 433 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); |
434 | 434 | ||
435 | string version; | ||
436 | |||
437 | if (!m_SimulationService.QueryAccess( | ||
438 | destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), | ||
439 | true, aCircuit.startpos, null, out version, out reason)) | ||
440 | return false; | ||
441 | |||
435 | return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); | 442 | return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); |
436 | } | 443 | } |
437 | 444 | ||
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 12ab478..ef014f9 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -85,8 +85,10 @@ namespace OpenSim.Services.Interfaces | |||
85 | /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param> | 85 | /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param> |
86 | /// <param name="viaTeleport">True: via teleport; False: via cross (walking)</param> | 86 | /// <param name="viaTeleport">True: via teleport; False: via cross (walking)</param> |
87 | /// <param name="position">Position in the region</param> | 87 | /// <param name="position">Position in the region</param> |
88 | /// <param name="sversion">version that the requesting simulator is runing</param> | 88 | /// <param name="sversion"> |
89 | /// <param name="version">version that the target simulator is running</param> | 89 | /// Version that the requesting simulator is runing. If null then no version check is carried out. |
90 | /// </param> | ||
91 | /// <param name="version">Version that the target simulator is running</param> | ||
90 | /// <param name="reason">[out] Optional error message</param> | 92 | /// <param name="reason">[out] Optional error message</param> |
91 | /// <returns>True: ok; False: not allowed</returns> | 93 | /// <returns>True: ok; False: not allowed</returns> |
92 | bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason); | 94 | bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason); |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 5888cce..264a630 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -959,12 +959,19 @@ namespace OpenSim.Services.LLLoginService | |||
959 | 959 | ||
960 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) | 960 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) |
961 | { | 961 | { |
962 | string version; | ||
963 | |||
964 | if (!simConnector.QueryAccess(region, aCircuit.AgentID, null, true, aCircuit.startpos, null, out version, out reason)) | ||
965 | return false; | ||
966 | |||
962 | return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); | 967 | return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); |
963 | } | 968 | } |
964 | 969 | ||
965 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) | 970 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) |
966 | { | 971 | { |
967 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 972 | string version; |
973 | |||
974 | m_log.Debug("[LLOGIN SERVICE]: Launching agent at " + destination.RegionName); | ||
968 | if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason)) | 975 | if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason)) |
969 | return true; | 976 | return true; |
970 | return false; | 977 | return false; |