diff options
author | Diva Canto | 2013-07-13 21:28:46 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-13 21:28:46 -0700 |
commit | b4f1b9acf65f9e782d56602e60c58be6145c5cca (patch) | |
tree | 33860eecce915dedd2c573f2d3aad026e63706bc /OpenSim/Server | |
parent | Deleted GET agent all around. Not used. (diff) | |
download | opensim-SC_OLD-b4f1b9acf65f9e782d56602e60c58be6145c5cca.zip opensim-SC_OLD-b4f1b9acf65f9e782d56602e60c58be6145c5cca.tar.gz opensim-SC_OLD-b4f1b9acf65f9e782d56602e60c58be6145c5cca.tar.bz2 opensim-SC_OLD-b4f1b9acf65f9e782d56602e60c58be6145c5cca.tar.xz |
Guard against unauthorized agent deletes.
Diffstat (limited to 'OpenSim/Server')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 17a8ef4..cd172e4 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -27,11 +27,13 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Specialized; | ||
30 | using System.IO; | 31 | using System.IO; |
31 | using System.IO.Compression; | 32 | using System.IO.Compression; |
32 | using System.Reflection; | 33 | using System.Reflection; |
33 | using System.Net; | 34 | using System.Net; |
34 | using System.Text; | 35 | using System.Text; |
36 | using System.Web; | ||
35 | 37 | ||
36 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
37 | using OpenSim.Server.Handlers.Base; | 39 | using OpenSim.Server.Handlers.Base; |
@@ -92,7 +94,11 @@ namespace OpenSim.Server.Handlers.Simulation | |||
92 | string method = (string)request["http-method"]; | 94 | string method = (string)request["http-method"]; |
93 | if (method.Equals("DELETE")) | 95 | if (method.Equals("DELETE")) |
94 | { | 96 | { |
95 | DoAgentDelete(request, responsedata, agentID, action, regionID); | 97 | string auth_token = string.Empty; |
98 | if (request.ContainsKey("auth")) | ||
99 | auth_token = request["auth"].ToString(); | ||
100 | |||
101 | DoAgentDelete(request, responsedata, agentID, action, regionID, auth_token); | ||
96 | return responsedata; | 102 | return responsedata; |
97 | } | 103 | } |
98 | else if (method.Equals("QUERYACCESS")) | 104 | else if (method.Equals("QUERYACCESS")) |
@@ -151,9 +157,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
151 | // Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]); | 157 | // Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]); |
152 | } | 158 | } |
153 | 159 | ||
154 | protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) | 160 | protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID, string auth_token) |
155 | { | 161 | { |
156 | m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); | 162 | m_log.DebugFormat("[AGENT HANDLER]: >>> DELETE action: {0}; RegionID: {1}; from: {2}; auth_code: {3}", action, regionID, Util.GetCallerIP(request), auth_token); |
157 | 163 | ||
158 | GridRegion destination = new GridRegion(); | 164 | GridRegion destination = new GridRegion(); |
159 | destination.RegionID = regionID; | 165 | destination.RegionID = regionID; |
@@ -161,12 +167,12 @@ namespace OpenSim.Server.Handlers.Simulation | |||
161 | if (action.Equals("release")) | 167 | if (action.Equals("release")) |
162 | ReleaseAgent(regionID, id); | 168 | ReleaseAgent(regionID, id); |
163 | else | 169 | else |
164 | Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id); }); | 170 | Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id, auth_token); }); |
165 | 171 | ||
166 | responsedata["int_response_code"] = HttpStatusCode.OK; | 172 | responsedata["int_response_code"] = HttpStatusCode.OK; |
167 | responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); | 173 | responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); |
168 | 174 | ||
169 | m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID); | 175 | //m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID); |
170 | } | 176 | } |
171 | 177 | ||
172 | protected virtual void ReleaseAgent(UUID regionID, UUID id) | 178 | protected virtual void ReleaseAgent(UUID regionID, UUID id) |