From 3c6becd52495360b24b3760a30fb0e007f5a16a3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 21 Jul 2014 23:53:33 +0100 Subject: On login and first HG entrance to a foreign grid, perform query access checks before proceeding. --- OpenSim/Services/HypergridService/GatekeeperService.cs | 7 +++++++ OpenSim/Services/Interfaces/ISimulationService.cs | 6 ++++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 9 ++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') 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 m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); + string version; + + if (!m_SimulationService.QueryAccess( + destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), + true, aCircuit.startpos, null, out version, out reason)) + return false; + return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); } 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 /// The visitor's Home URI. Will be missing (null) in older OpenSims. /// True: via teleport; False: via cross (walking) /// Position in the region - /// version that the requesting simulator is runing - /// version that the target simulator is running + /// + /// Version that the requesting simulator is runing. If null then no version check is carried out. + /// + /// Version that the target simulator is running /// [out] Optional error message /// True: ok; False: not allowed 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 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) { + string version; + + if (!simConnector.QueryAccess(region, aCircuit.AgentID, null, true, aCircuit.startpos, null, out version, out reason)) + return false; + return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); } private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) { - m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); + string version; + + m_log.Debug("[LLOGIN SERVICE]: Launching agent at " + destination.RegionName); if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason)) return true; return false; -- cgit v1.1