From 5aa8ba1b45c8a0a2965888287ba68e5773471db8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Tue, 11 Nov 2014 17:28:41 +0000 Subject: Fix issue where llRemoteLoadScriptPin() would treat 0 (the default) as a valid set pin in a destination prim rather than the unset no pin state Adds regression test for this case. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3c120ff..5cc5606 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1940,8 +1940,11 @@ namespace OpenSim.Region.Framework.Scenes /// Rez a script into a prim's inventory from another prim /// /// - /// - /// + /// + /// + /// + /// + /// public void RezScriptFromPrim(UUID srcId, SceneObjectPart srcPart, UUID destId, int pin, int running, int start_param) { TaskInventoryItem srcTaskItem = srcPart.Inventory.GetInventoryItem(srcId); @@ -1961,12 +1964,11 @@ namespace OpenSim.Region.Framework.Scenes if (destPart == null) { m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Could not find script for ID {0}", - destId); + "[PRIM INVENTORY]: Could not find part {0} to insert script item {1} from {2} {3} in {4}", + destId, srcId, srcPart.Name, srcPart.UUID, Name); return; } - + // Must own the object, and have modify rights if (srcPart.OwnerID != destPart.OwnerID) { @@ -1974,12 +1976,14 @@ namespace OpenSim.Region.Framework.Scenes if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0)) return; - } else { + } + else + { if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) return; } - if (destPart.ScriptAccessPin != pin) + if (destPart.ScriptAccessPin == 0 || destPart.ScriptAccessPin != pin) { m_log.WarnFormat( "[PRIM INVENTORY]: " + -- cgit v1.1