diff options
author | Dr Scofield | 2008-07-01 08:50:22 +0000 |
---|---|---|
committer | Dr Scofield | 2008-07-01 08:50:22 +0000 |
commit | 0a657b941606f6edb5a27bc047f122a6255f1706 (patch) | |
tree | 402cfb783f7d278e5547d2c570e9f433956d4323 /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |
parent | From: kurt taylor (krtaylor) (diff) | |
download | opensim-SC-0a657b941606f6edb5a27bc047f122a6255f1706.zip opensim-SC-0a657b941606f6edb5a27bc047f122a6255f1706.tar.gz opensim-SC-0a657b941606f6edb5a27bc047f122a6255f1706.tar.bz2 opensim-SC-0a657b941606f6edb5a27bc047f122a6255f1706.tar.xz |
making XmlRpcs of RemoteController more robust; this fixes mantis #1467
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index d3fe0e0..2239001 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -98,12 +98,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
98 | public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) | 98 | public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) |
99 | { | 99 | { |
100 | XmlRpcResponse response = new XmlRpcResponse(); | 100 | XmlRpcResponse response = new XmlRpcResponse(); |
101 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
102 | |||
103 | Hashtable responseData = new Hashtable(); | 101 | Hashtable responseData = new Hashtable(); |
104 | 102 | ||
105 | m_log.Info("[RADMIN]: Request to restart Region."); | ||
106 | try { | 103 | try { |
104 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
105 | |||
106 | m_log.Info("[RADMIN]: Request to restart Region."); | ||
107 | checkStringParameters(request, new string[] { "password", "regionID" }); | 107 | checkStringParameters(request, new string[] { "password", "regionID" }); |
108 | 108 | ||
109 | if (requiredPassword != String.Empty && | 109 | if (requiredPassword != String.Empty && |
@@ -140,10 +140,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
140 | public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request) | 140 | public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request) |
141 | { | 141 | { |
142 | XmlRpcResponse response = new XmlRpcResponse(); | 142 | XmlRpcResponse response = new XmlRpcResponse(); |
143 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
144 | Hashtable responseData = new Hashtable(); | 143 | Hashtable responseData = new Hashtable(); |
145 | 144 | ||
146 | try { | 145 | try { |
146 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
147 | |||
147 | checkStringParameters(request, new string[] { "password", "message" }); | 148 | checkStringParameters(request, new string[] { "password", "message" }); |
148 | 149 | ||
149 | if (requiredPassword != String.Empty && | 150 | if (requiredPassword != String.Empty && |
@@ -175,17 +176,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
175 | public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request) | 176 | public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request) |
176 | { | 177 | { |
177 | XmlRpcResponse response = new XmlRpcResponse(); | 178 | XmlRpcResponse response = new XmlRpcResponse(); |
178 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
179 | |||
180 | m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request.ToString()); | ||
181 | foreach (string k in requestData.Keys) | ||
182 | { | ||
183 | m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}", | ||
184 | k, (string)requestData[k], ((string)requestData[k]).Length); | ||
185 | } | ||
186 | |||
187 | Hashtable responseData = new Hashtable(); | 179 | Hashtable responseData = new Hashtable(); |
180 | |||
188 | try { | 181 | try { |
182 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
183 | |||
184 | m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request.ToString()); | ||
185 | // foreach (string k in requestData.Keys) | ||
186 | // { | ||
187 | // m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}", | ||
188 | // k, (string)requestData[k], ((string)requestData[k]).Length); | ||
189 | // } | ||
190 | |||
189 | checkStringParameters(request, new string[] { "password", "filename", "regionid"}); | 191 | checkStringParameters(request, new string[] { "password", "filename", "regionid"}); |
190 | 192 | ||
191 | if (requiredPassword != String.Empty && | 193 | if (requiredPassword != String.Empty && |
@@ -227,10 +229,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
227 | { | 229 | { |
228 | m_log.Info("[RADMIN]: Received Shutdown Administrator Request"); | 230 | m_log.Info("[RADMIN]: Received Shutdown Administrator Request"); |
229 | XmlRpcResponse response = new XmlRpcResponse(); | 231 | XmlRpcResponse response = new XmlRpcResponse(); |
230 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
231 | Hashtable responseData = new Hashtable(); | 232 | Hashtable responseData = new Hashtable(); |
232 | 233 | ||
233 | try { | 234 | try { |
235 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
236 | |||
234 | if (requiredPassword != String.Empty && | 237 | if (requiredPassword != String.Empty && |
235 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) | 238 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) |
236 | throw new Exception("wrong password"); | 239 | throw new Exception("wrong password"); |
@@ -355,10 +358,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
355 | { | 358 | { |
356 | m_log.Info("[RADMIN]: CreateRegion: new request"); | 359 | m_log.Info("[RADMIN]: CreateRegion: new request"); |
357 | XmlRpcResponse response = new XmlRpcResponse(); | 360 | XmlRpcResponse response = new XmlRpcResponse(); |
358 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
359 | Hashtable responseData = new Hashtable(); | 361 | Hashtable responseData = new Hashtable(); |
360 | 362 | ||
361 | try { | 363 | try { |
364 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
365 | |||
362 | checkStringParameters(request, new string[] { "password", | 366 | checkStringParameters(request, new string[] { "password", |
363 | "region_name", | 367 | "region_name", |
364 | "region_master_first", "region_master_last", | 368 | "region_master_first", "region_master_last", |
@@ -507,11 +511,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
507 | { | 511 | { |
508 | m_log.Info("[RADMIN]: CreateUser: new request"); | 512 | m_log.Info("[RADMIN]: CreateUser: new request"); |
509 | XmlRpcResponse response = new XmlRpcResponse(); | 513 | XmlRpcResponse response = new XmlRpcResponse(); |
510 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
511 | Hashtable responseData = new Hashtable(); | 514 | Hashtable responseData = new Hashtable(); |
512 | 515 | ||
513 | try | 516 | try |
514 | { | 517 | { |
518 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
519 | |||
515 | // check completeness | 520 | // check completeness |
516 | checkStringParameters(request, new string[] { "password", "user_firstname", | 521 | checkStringParameters(request, new string[] { "password", "user_firstname", |
517 | "user_lastname", "user_password" }); | 522 | "user_lastname", "user_password" }); |
@@ -563,11 +568,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
563 | { | 568 | { |
564 | m_log.Info("[RADMIN]: Received Load XML Administrator Request"); | 569 | m_log.Info("[RADMIN]: Received Load XML Administrator Request"); |
565 | XmlRpcResponse response = new XmlRpcResponse(); | 570 | XmlRpcResponse response = new XmlRpcResponse(); |
566 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
567 | Hashtable responseData = new Hashtable(); | 571 | Hashtable responseData = new Hashtable(); |
568 | 572 | ||
569 | try | 573 | try |
570 | { | 574 | { |
575 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
576 | |||
571 | // check completeness | 577 | // check completeness |
572 | foreach (string p in new string[] { "password", "filename" }) | 578 | foreach (string p in new string[] { "password", "filename" }) |
573 | { | 579 | { |