From 44d84bc2779165e75224975e83ca4539a00e9d24 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Feb 2012 19:58:34 +0000 Subject: Fix bug where somebody taking a copy of an object they didn't own that was rezzed before the region was restarted would wrongly place the copy in the object owner's inventory. Addresses http://opensimulator.org/mantis/view.php?id=5825 --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 12 ++++++++++-- .../Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 8b5b1a7..63ba3d3 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -546,12 +546,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return null; userID = remoteClient.AgentId; + +// m_log.DebugFormat( +// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", +// action, remoteClient.Name, userID); } else { // All returns / deletes go to the object owner // userID = so.RootPart.OwnerID; + +// m_log.DebugFormat( +// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is object owner {1}", +// action, userID); } if (userID == UUID.Zero) // Can't proceed @@ -637,11 +645,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } // Override and put into where it came from, if it came - // from anywhere in inventory + // from anywhere in inventory and the owner is taking it back. // if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) { - if (so.RootPart.FromFolderID != UUID.Zero) + if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId) { InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID); folder = m_Scene.InventoryService.GetFolder(f); diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 5dfd3e0..f678d07 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -148,7 +148,8 @@ namespace OpenSim.Region.Framework.Scenes x = m_inventoryDeletes.Dequeue(); m_log.DebugFormat( - "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count); + "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", + left, x.action, x.objectGroups.Count); try { -- cgit v1.1