From ff429a259b41f1205a6b153bb6da383d9a9f5daf Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 23 May 2012 01:58:10 +0100
Subject: Fix bug where an avatar that had an object they owned attached
through llAttachToAvatar() or osForceAttachToAvatar() would wrongly have next
permissions come into play when they detached that object and rezzed it in
scene.
This is because the attachments module code was setting the 'object slam' bit by using PermissionMask.All
Solution here is to route the attachment item creation call through the existing inventory code in BasicInventoryAccessModule rather than copy/pasted code in AttachmentsModule itself.
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3734e03..d27d9e1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1027,10 +1027,16 @@ namespace OpenSim.Region.Framework.Scenes
public void ApplyNextOwnerPermissions()
{
+ Util.PrintCallStack();
+
lock (m_items)
{
foreach (TaskInventoryItem item in m_items.Values)
{
+// m_log.DebugFormat (
+// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
+// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
+
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
{
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
@@ -1040,6 +1046,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
}
+
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
--
cgit v1.1
From 9f1fc7ea8816e8a052e41b58d4cde077bc58b9e5 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 May 2012 02:54:37 +0100
Subject: Remove a call stack debugging line accidentally left in from a few
days ago at SceneObjectPartInventory.ApplyNextOwnerPermissions().
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 --
1 file changed, 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d27d9e1..aaf9ffa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1027,8 +1027,6 @@ namespace OpenSim.Region.Framework.Scenes
public void ApplyNextOwnerPermissions()
{
- Util.PrintCallStack();
-
lock (m_items)
{
foreach (TaskInventoryItem item in m_items.Values)
--
cgit v1.1
From ff53add54dbc666e585b928ba51b4babb7441611 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 May 2012 00:36:01 +0100
Subject: refactor: replace LSL_Api.InventoryKey(string) largely with
SceneObjectPartInventory.GetInventoryItem(string)
Also gets llStopAnimation() to call KeyOrName rather than duplicating logic.
---
.../Framework/Scenes/SceneObjectPartInventory.cs | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index aaf9ffa..8810903 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -582,14 +582,20 @@ namespace OpenSim.Region.Framework.Scenes
return item;
}
- ///
- /// Get inventory items by name.
- ///
- ///
- ///
- /// A list of inventory items with that name.
- /// If no inventory item has that name then an empty list is returned.
- ///
+ public TaskInventoryItem GetInventoryItem(string name)
+ {
+ lock (m_items)
+ {
+ foreach (TaskInventoryItem item in m_items.Values)
+ {
+ if (item.Name == name)
+ return item;
+ }
+ }
+
+ return null;
+ }
+
public List GetInventoryItems(string name)
{
List items = new List();
--
cgit v1.1