From ec6f87d3eff699ca28214629d360c15e5df13156 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 Jan 2018 23:51:43 +0000 Subject: [PATCH] disable some XmlResolver --- .../ApplicationPlugins/LoadRegions/RegionLoaderWebServer.cs | 1 + .../ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 1 + OpenSim/ConsoleClient/ConsoleClient.cs | 2 ++ .../Serialization/External/ExternalRepresentationUtils.cs | 1 + OpenSim/Framework/Util.cs | 1 + .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 2 ++ .../Framework/InventoryAccess/Tests/HGAssetMapperTests.cs | 1 + .../Region/CoreModules/World/Serialiser/SerialiseObjects.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 1 + .../Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++-- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 +- .../Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 1 + .../Framework/Scenes/Serialization/SceneObjectSerializer.cs | 1 + .../Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs | 1 + OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 2 ++ OpenSim/Server/Base/ServerUtils.cs | 2 +- 17 files changed, 23 insertions(+), 5 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderWebServer.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderWebServer.cs index 13d7a8ad4e..2b91fc5c55 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderWebServer.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderWebServer.cs @@ -93,6 +93,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + xmlSource.Length); XmlDocument xmlDoc = new XmlDocument(); + xmlDoc.XmlResolver = null; xmlDoc.LoadXml(xmlSource); if (xmlDoc.FirstChild.Name == "Nini") { diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 510905f64e..84d87f176c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -3138,6 +3138,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (File.Exists(defaultAppearanceFileName)) { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; string name = "*unknown*"; string email = "anon@anon"; uint regionXLocation = 1000; diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index e689424d7d..c395cd7347 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs @@ -110,6 +110,7 @@ namespace OpenSim.ConsoleClient public static void LoginReply(string requestUrl, string requestData, string replyData) { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(replyData); @@ -169,6 +170,7 @@ namespace OpenSim.ConsoleClient public static void ReadResponses(string requestUrl, string requestData, string replyData) { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(replyData); diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 1523fa9e0b..d2ca04949e 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -156,6 +156,7 @@ namespace OpenSim.Framework.Serialization.External return xml; XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(xml); XmlNodeList sops = doc.GetElementsByTagName("SceneObjectPart"); diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a42dcc6f6c..70930107d2 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -671,6 +671,7 @@ namespace OpenSim.Framework public static string GetFormattedXml(string rawXml) { XmlDocument xd = new XmlDocument(); + xd.XmlResolver=null; xd.LoadXml(rawXml); StringBuilder sb = new StringBuilder(); diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 5bca482af3..9f52a14ee4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -306,6 +306,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0} from simulator-side", sp.Name); XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; string stateData = String.Empty; IAttachmentsService attServ = m_scene.RequestModuleInterface(); @@ -372,6 +373,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (itemData.TryGetValue(attach.ItemID, out xmlData)) { d = new XmlDocument(); + d.XmlResolver=null; d.LoadXml(xmlData); m_log.InfoFormat("[ATTACHMENT]: Found saved state for item {0}, loading it", attach.ItemID); } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs index 8f12331394..01c5d3b931 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs @@ -93,6 +93,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests Assert.AreEqual(foreignUrl, ncAssetGet.CreatorID); string xmlData = Utils.BytesToString(ncAssetGet.Data); XmlDocument ncAssetGetXmlDoc = new XmlDocument(); + ncAssetGetXmlDoc.XmlResolver=null; ncAssetGetXmlDoc.LoadXml(xmlData); // Console.WriteLine(ncAssetGetXmlDoc.OuterXml); diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs index 65f464afea..52a80d6292 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser MemoryStream stream = new MemoryStream(); XmlTextWriter formatter = new XmlTextWriter(stream, Encoding.UTF8); XmlDocument doc = new XmlDocument(); - + doc.XmlResolver=null; doc.LoadXml(xmlstream); formatter.Formatting = Formatting.Indented; doc.WriteContentTo(formatter); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f29cdf4c43..71c8807991 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2420,6 +2420,7 @@ namespace OpenSim.Region.Framework.Scenes else { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(xmlData); XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); XmlElement coll = (XmlElement)e; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index bf217a5f3c..c20c81db49 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -505,6 +505,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (KeyValuePair state in states) { XmlDocument sdoc = new XmlDocument(); + sdoc.XmlResolver=null; sdoc.LoadXml(state.Value); XmlNodeList rootL = sdoc.GetElementsByTagName("State"); XmlNode rootNode = rootL[0]; @@ -540,6 +541,7 @@ namespace OpenSim.Region.Framework.Scenes return; XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; try { doc.LoadXml(objXMLData); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3380191221..21311b0bcb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1994,6 +1994,7 @@ namespace OpenSim.Region.Framework.Scenes public void SaveScriptedState(XmlTextWriter writer, bool oldIDs) { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; Dictionary states = new Dictionary(); SceneObjectPart[] parts = m_parts.GetArray(); @@ -2782,7 +2783,7 @@ namespace OpenSim.Region.Framework.Scenes return RootPart.Torque; } - // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object + // This is used by llMoveToTarget() in an attached object public void MoveToTarget(Vector3 target, float tau) { if (IsAttachment) @@ -2790,7 +2791,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); if (avatar != null) - avatar.MoveToTarget(target, false, false); + avatar.MoveToTarget(target, false, false, tau); } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index de9d9862f3..30f7151ad3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -455,7 +455,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_part.ParentGroup.m_savedScriptState.ContainsKey(stateID)) { XmlDocument doc = new XmlDocument(); - + doc.XmlResolver=null; doc.LoadXml(m_part.ParentGroup.m_savedScriptState[stateID]); ////////// CRUFT WARNING /////////////////////////////////// diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index 41f3ef4020..a93782e7f1 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -147,6 +147,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(xml); XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); if (e == null) diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 82bbe6f384..948c345d46 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -255,6 +255,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization try { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; doc.LoadXml(xmlData); XmlNodeList parts = doc.GetElementsByTagName("SceneObjectPart"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs index bcdc7bf5dd..cfe21fcd7b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs @@ -207,6 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public static void Deserialize(string xml, ScriptInstance instance) { XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; Dictionary vars = instance.GetVars(); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 65ce61dd75..05124fc65a 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -2098,6 +2098,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine string xml = instance.GetXMLState(); XmlDocument sdoc = new XmlDocument(); + sdoc.XmlResolver=null; bool loadedState = true; try { @@ -2253,6 +2254,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return false; XmlDocument doc = new XmlDocument(); + doc.XmlResolver=null; try { diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index d0043ba7d9..cc506bcd24 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -513,7 +513,7 @@ namespace OpenSim.Server.Base Dictionary ret = new Dictionary(); XmlDocument doc = new XmlDocument(); - + doc.XmlResolver = null; try { doc.LoadXml(data);