aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-08-24 00:15:30 +0100
committerMelanie2012-08-24 00:15:30 +0100
commitc55768466626336849c650349b335365c41359e5 (patch)
tree5050a16ac8dc0033ee8f730b914f6e6464d879b3 /OpenSim/Region/Framework/Scenes
parentIf a script state save fails for some reason on shutdown/region removal, get ... (diff)
downloadopensim-SC_OLD-c55768466626336849c650349b335365c41359e5.zip
opensim-SC_OLD-c55768466626336849c650349b335365c41359e5.tar.gz
opensim-SC_OLD-c55768466626336849c650349b335365c41359e5.tar.bz2
opensim-SC_OLD-c55768466626336849c650349b335365c41359e5.tar.xz
Fix bad child prim permissions that can make objects change perms after rezzing
Port from Avination
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs21
3 files changed, 39 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 7e31d60..675c64d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1943,6 +1943,9 @@ namespace OpenSim.Region.Framework.Scenes
1943 deleteIDs.Add(localID); 1943 deleteIDs.Add(localID);
1944 deleteGroups.Add(grp); 1944 deleteGroups.Add(grp);
1945 1945
1946 // If child prims have invalid perms, fix them
1947 grp.AdjustChildPrimPermissions();
1948
1946 if (remoteClient == null) 1949 if (remoteClient == null)
1947 { 1950 {
1948 // Autoreturn has a null client. Nothing else does. So 1951 // Autoreturn has a null client. Nothing else does. So
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f6c725b..b4a155e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2131,6 +2131,9 @@ namespace OpenSim.Region.Framework.Scenes
2131 // Can't do this yet since backup still makes use of the root part without any synchronization 2131 // Can't do this yet since backup still makes use of the root part without any synchronization
2132// objectGroup.m_rootPart = null; 2132// objectGroup.m_rootPart = null;
2133 2133
2134 // If linking prims with different permissions, fix them
2135 AdjustChildPrimPermissions();
2136
2134 AttachToBackup(); 2137 AttachToBackup();
2135 2138
2136 // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the 2139 // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
@@ -2622,12 +2625,21 @@ namespace OpenSim.Region.Framework.Scenes
2622 } 2625 }
2623 } 2626 }
2624 2627
2628 public void AdjustChildPrimPermissions()
2629 {
2630 ForEachPart(part =>
2631 {
2632 if (part != RootPart)
2633 part.ClonePermissions(RootPart);
2634 });
2635 }
2636
2625 public void UpdatePermissions(UUID AgentID, byte field, uint localID, 2637 public void UpdatePermissions(UUID AgentID, byte field, uint localID,
2626 uint mask, byte addRemTF) 2638 uint mask, byte addRemTF)
2627 { 2639 {
2628 SceneObjectPart[] parts = m_parts.GetArray(); 2640 RootPart.UpdatePermissions(AgentID, field, localID, mask, addRemTF);
2629 for (int i = 0; i < parts.Length; i++) 2641
2630 parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); 2642 AdjustChildPrimPermissions();
2631 2643
2632 HasGroupChanged = true; 2644 HasGroupChanged = true;
2633 2645
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2a9ee3a..411dcc7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3890,6 +3890,27 @@ namespace OpenSim.Region.Framework.Scenes
3890 } 3890 }
3891 } 3891 }
3892 3892
3893 public void ClonePermissions(SceneObjectPart source)
3894 {
3895 bool update = false;
3896
3897 if (BaseMask != source.BaseMask ||
3898 OwnerMask != source.OwnerMask ||
3899 GroupMask != source.GroupMask ||
3900 EveryoneMask != source.EveryoneMask ||
3901 NextOwnerMask != source.NextOwnerMask)
3902 update = true;
3903
3904 BaseMask = source.BaseMask;
3905 OwnerMask = source.OwnerMask;
3906 GroupMask = source.GroupMask;
3907 EveryoneMask = source.EveryoneMask;
3908 NextOwnerMask = source.NextOwnerMask;
3909
3910 if (update)
3911 SendFullUpdateToAllClients();
3912 }
3913
3893 public bool IsHingeJoint() 3914 public bool IsHingeJoint()
3894 { 3915 {
3895 // For now, we use the NINJA naming scheme for identifying joints. 3916 // For now, we use the NINJA naming scheme for identifying joints.