aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-05-23 01:58:10 +0100
committerJustin Clark-Casey (justincc)2012-05-23 01:58:10 +0100
commitff429a259b41f1205a6b153bb6da383d9a9f5daf (patch)
tree70d7a495cc6d846ef593f8bb0ed608c31b78f079 /OpenSim/Region/Framework/Scenes
parentSetting 'in transit' on a local teleport as well as inter-region teleports. (diff)
downloadopensim-SC-ff429a259b41f1205a6b153bb6da383d9a9f5daf.zip
opensim-SC-ff429a259b41f1205a6b153bb6da383d9a9f5daf.tar.gz
opensim-SC-ff429a259b41f1205a6b153bb6da383d9a9f5daf.tar.bz2
opensim-SC-ff429a259b41f1205a6b153bb6da383d9a9f5daf.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs20
3 files changed, 26 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 834464b..f555b49 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Framework.Scenes
155 { 155 {
156 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); 156 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
157 if (invAccess != null) 157 if (invAccess != null)
158 invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient); 158 invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient, false);
159 159
160 if (x.permissionToDelete) 160 if (x.permissionToDelete)
161 { 161 {
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
1027 1027
1028 public void ApplyNextOwnerPermissions() 1028 public void ApplyNextOwnerPermissions()
1029 { 1029 {
1030 Util.PrintCallStack();
1031
1030 lock (m_items) 1032 lock (m_items)
1031 { 1033 {
1032 foreach (TaskInventoryItem item in m_items.Values) 1034 foreach (TaskInventoryItem item in m_items.Values)
1033 { 1035 {
1036// m_log.DebugFormat (
1037// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
1038// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
1039
1034 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) 1040 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
1035 { 1041 {
1036 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) 1042 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
@@ -1040,6 +1046,7 @@ namespace OpenSim.Region.Framework.Scenes
1040 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) 1046 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
1041 item.CurrentPermissions &= ~(uint)PermissionMask.Modify; 1047 item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
1042 } 1048 }
1049
1043 item.CurrentPermissions &= item.NextPermissions; 1050 item.CurrentPermissions &= item.NextPermissions;
1044 item.BasePermissions &= item.NextPermissions; 1051 item.BasePermissions &= item.NextPermissions;
1045 item.EveryonePermissions &= item.NextPermissions; 1052 item.EveryonePermissions &= item.NextPermissions;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
index 55455cc..a4f730d 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -47,14 +47,30 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
47 /// </remarks> 47 /// </remarks>
48 public class CoalescedSceneObjectsSerializer 48 public class CoalescedSceneObjectsSerializer
49 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51 51
52 /// <summary> 52 /// <summary>
53 /// Serialize coalesced objects to Xml 53 /// Serialize coalesced objects to Xml
54 /// </summary> 54 /// </summary>
55 /// <param name="coa"></param> 55 /// <param name="coa"></param>
56 /// <param name="doScriptStates">
57 /// If true then serialize script states. This will halt any running scripts
58 /// </param>
56 /// <returns></returns> 59 /// <returns></returns>
57 public static string ToXml(CoalescedSceneObjects coa) 60 public static string ToXml(CoalescedSceneObjects coa)
61 {
62 return ToXml(coa, true);
63 }
64
65 /// <summary>
66 /// Serialize coalesced objects to Xml
67 /// </summary>
68 /// <param name="coa"></param>
69 /// <param name="doScriptStates">
70 /// If true then serialize script states. This will halt any running scripts
71 /// </param>
72 /// <returns></returns>
73 public static string ToXml(CoalescedSceneObjects coa, bool doScriptStates)
58 { 74 {
59 using (StringWriter sw = new StringWriter()) 75 using (StringWriter sw = new StringWriter())
60 { 76 {
@@ -91,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
91 writer.WriteAttributeString("offsety", offsets[i].Y.ToString()); 107 writer.WriteAttributeString("offsety", offsets[i].Y.ToString());
92 writer.WriteAttributeString("offsetz", offsets[i].Z.ToString()); 108 writer.WriteAttributeString("offsetz", offsets[i].Z.ToString());
93 109
94 SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, true); 110 SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, doScriptStates);
95 111
96 writer.WriteEndElement(); // SceneObjectGroup 112 writer.WriteEndElement(); // SceneObjectGroup
97 } 113 }