diff options
author | Oren Hurvitz | 2014-05-18 19:45:27 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-05-19 11:19:11 +0100 |
commit | 47b84875fd2b9f01140288a2695c33f5ef4466c0 (patch) | |
tree | dd22882762b4e4ec411de5c37d98fd1a394835b2 | |
parent | Log the user when an inventory operation is blocked because the item/folder i... (diff) | |
download | opensim-SC_OLD-47b84875fd2b9f01140288a2695c33f5ef4466c0.zip opensim-SC_OLD-47b84875fd2b9f01140288a2695c33f5ef4466c0.tar.gz opensim-SC_OLD-47b84875fd2b9f01140288a2695c33f5ef4466c0.tar.bz2 opensim-SC_OLD-47b84875fd2b9f01140288a2695c33f5ef4466c0.tar.xz |
Tell QueryAccess explicitly whether the user is coming in via Teleport or Cross, because the permission checks are different.
Previously we used a heuristic of checking if the entry position is 0 to differentiate between Teleport and Cross, but that doesn't work anymore since we've started providing the precise entry position for cross, too. That's required in order to ensure that the user is allowed to enter the parcel that he's walking into.
Diffstat (limited to '')
7 files changed, 18 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3830791..e583590 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -761,7 +761,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
761 | string reason; | 761 | string reason; |
762 | string version; | 762 | string version; |
763 | if (!Scene.SimulationService.QueryAccess( | 763 | if (!Scene.SimulationService.QueryAccess( |
764 | finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason)) | 764 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, out version, out reason)) |
765 | { | 765 | { |
766 | sp.ControllingClient.SendTeleportFailed(reason); | 766 | sp.ControllingClient.SendTeleportFailed(reason); |
767 | 767 | ||
@@ -1510,7 +1510,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1510 | 1510 | ||
1511 | // Check to see if we have access to the target region. | 1511 | // Check to see if we have access to the target region. |
1512 | if (neighbourRegion != null | 1512 | if (neighbourRegion != null |
1513 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason)) | 1513 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, out version, out failureReason)) |
1514 | { | 1514 | { |
1515 | // remember banned | 1515 | // remember banned |
1516 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); | 1516 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 3348b42..926ef05 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
264 | return true; | 264 | return true; |
265 | } | 265 | } |
266 | 266 | ||
267 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | 267 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) |
268 | { | 268 | { |
269 | reason = "Communications failure"; | 269 | reason = "Communications failure"; |
270 | version = ServiceVersion; | 270 | version = ServiceVersion; |
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
277 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | 277 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", |
278 | // s.RegionInfo.RegionName, destination.RegionHandle); | 278 | // s.RegionInfo.RegionName, destination.RegionHandle); |
279 | 279 | ||
280 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason); | 280 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); |
281 | } | 281 | } |
282 | 282 | ||
283 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); | 283 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 8436488..0444e49 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
208 | } | 208 | } |
209 | 209 | ||
210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) |
211 | { | 211 | { |
212 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
213 | version = "Unknown"; | 213 | version = "Unknown"; |
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
216 | return false; | 216 | return false; |
217 | 217 | ||
218 | // Try local first | 218 | // Try local first |
219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason)) | 219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason)) |
220 | return true; | 220 | return true; |
221 | 221 | ||
222 | // else do the remote thing | 222 | // else do the remote thing |
223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | 223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); | 224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason); |
225 | 225 | ||
226 | return false; | 226 | return false; |
227 | } | 227 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1115399..3b8fbfd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5463,7 +5463,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5463 | /// <param name='position'></param> | 5463 | /// <param name='position'></param> |
5464 | /// <param name='reason'></param> | 5464 | /// <param name='reason'></param> |
5465 | /// <returns></returns> | 5465 | /// <returns></returns> |
5466 | public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason) | 5466 | public bool QueryAccess(UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string reason) |
5467 | { | 5467 | { |
5468 | reason = string.Empty; | 5468 | reason = string.Empty; |
5469 | 5469 | ||
@@ -5529,7 +5529,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5529 | return false; | 5529 | return false; |
5530 | } | 5530 | } |
5531 | 5531 | ||
5532 | if (position == Vector3.Zero) // Teleport | 5532 | if (viaTeleport) |
5533 | { | 5533 | { |
5534 | if (!RegionInfo.EstateSettings.AllowDirectTeleport) | 5534 | if (!RegionInfo.EstateSettings.AllowDirectTeleport) |
5535 | { | 5535 | { |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 06392f7..7291931 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -132,6 +132,10 @@ namespace OpenSim.Server.Handlers.Simulation | |||
132 | // m_log.DebugFormat("[AGENT HANDLER]: Received QUERYACCESS with {0}", (string)request["body"]); | 132 | // m_log.DebugFormat("[AGENT HANDLER]: Received QUERYACCESS with {0}", (string)request["body"]); |
133 | OSDMap args = Utils.GetOSDMap((string)request["body"]); | 133 | OSDMap args = Utils.GetOSDMap((string)request["body"]); |
134 | 134 | ||
135 | bool viaTeleport = true; | ||
136 | if (args.ContainsKey("viaTeleport")) | ||
137 | viaTeleport = args["viaTeleport"].AsBoolean(); | ||
138 | |||
135 | Vector3 position = Vector3.Zero; | 139 | Vector3 position = Vector3.Zero; |
136 | if (args.ContainsKey("position")) | 140 | if (args.ContainsKey("position")) |
137 | position = Vector3.Parse(args["position"].AsString()); | 141 | position = Vector3.Parse(args["position"].AsString()); |
@@ -145,7 +149,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
145 | 149 | ||
146 | string reason; | 150 | string reason; |
147 | string version; | 151 | string version; |
148 | bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); | 152 | bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason); |
149 | 153 | ||
150 | responsedata["int_response_code"] = HttpStatusCode.OK; | 154 | responsedata["int_response_code"] = HttpStatusCode.OK; |
151 | 155 | ||
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index d9fe5a0..099ba98 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -282,7 +282,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
285 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | 285 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) |
286 | { | 286 | { |
287 | reason = "Failed to contact destination"; | 287 | reason = "Failed to contact destination"; |
288 | version = "Unknown"; | 288 | version = "Unknown"; |
@@ -296,6 +296,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
296 | string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/"; | 296 | string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/"; |
297 | 297 | ||
298 | OSDMap request = new OSDMap(); | 298 | OSDMap request = new OSDMap(); |
299 | request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); | ||
299 | request.Add("position", OSD.FromString(position.ToString())); | 300 | request.Add("position", OSD.FromString(position.ToString())); |
300 | if (agentHomeURI != null) | 301 | if (agentHomeURI != null) |
301 | request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); | 302 | request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 375a35c..8b87ac0 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -83,11 +83,12 @@ namespace OpenSim.Services.Interfaces | |||
83 | /// <param name="destination">Desired destination</param> | 83 | /// <param name="destination">Desired destination</param> |
84 | /// <param name="agentID">The visitor's User ID</param> | 84 | /// <param name="agentID">The visitor's User ID</param> |
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="position">Position in the region</param> | 87 | /// <param name="position">Position in the region</param> |
87 | /// <param name="version"></param> | 88 | /// <param name="version"></param> |
88 | /// <param name="reason">[out] Optional error message</param> | 89 | /// <param name="reason">[out] Optional error message</param> |
89 | /// <returns>True: ok; False: not allowed</returns> | 90 | /// <returns>True: ok; False: not allowed</returns> |
90 | bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason); | 91 | bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason); |
91 | 92 | ||
92 | /// <summary> | 93 | /// <summary> |
93 | /// Message from receiving region to departing region, telling it got contacted by the client. | 94 | /// Message from receiving region to departing region, telling it got contacted by the client. |