From 04845c1898fee6a8b8563a8103b73cbe38525416 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 30 Apr 2010 11:46:50 +0100
Subject: Fix link security issue
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 41 ++++++---------------------
1 file changed, 9 insertions(+), 32 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d31b45e..ad24160 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1619,20 +1619,21 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds)
+ protected internal void LinkObjects(SceneObjectPart root, List children)
{
Monitor.Enter(m_updateLock);
try
{
- SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId);
+ SceneObjectGroup parentGroup = root.ParentGroup;
List childGroups = new List();
if (parentGroup != null)
{
// We do this in reverse to get the link order of the prims correct
- for (int i = childPrimIds.Count - 1; i >= 0; i--)
+ for (int i = children.Count - 1; i >= 0; i--)
{
- SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]);
+ SceneObjectGroup child = children[i].ParentGroup;
+
if (child != null)
{
// Make sure no child prim is set for sale
@@ -1665,17 +1666,6 @@ namespace OpenSim.Region.Framework.Scenes
parentGroup.HasGroupChanged = true;
parentGroup.ScheduleGroupForFullUpdate();
-// if (client != null)
-// {
-// parentGroup.GetProperties(client);
-// }
-// else
-// {
-// foreach (ScenePresence p in GetScenePresences())
-// {
-// parentGroup.GetProperties(p.ControllingClient);
-// }
-// }
}
finally
{
@@ -1687,12 +1677,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Delink a linkset
///
///
- protected internal void DelinkObjects(List primIds)
- {
- DelinkObjects(primIds, true);
- }
-
- protected internal void DelinkObjects(List primIds, bool sendEvents)
+ protected internal void DelinkObjects(List prims)
{
Monitor.Enter(m_updateLock);
try
@@ -1702,9 +1687,8 @@ namespace OpenSim.Region.Framework.Scenes
List affectedGroups = new List();
// Look them all up in one go, since that is comparatively expensive
//
- foreach (uint primID in primIds)
+ foreach (SceneObjectPart part in prims)
{
- SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
if (part != null)
{
if (part.ParentGroup.Children.Count != 1) // Skip single
@@ -1719,17 +1703,13 @@ namespace OpenSim.Region.Framework.Scenes
affectedGroups.Add(group);
}
}
- else
- {
- m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
- }
}
foreach (SceneObjectPart child in childParts)
{
// Unlink all child parts from their groups
//
- child.ParentGroup.DelinkFromGroup(child, sendEvents);
+ child.ParentGroup.DelinkFromGroup(child, true);
}
foreach (SceneObjectPart root in rootParts)
@@ -1784,12 +1764,9 @@ namespace OpenSim.Region.Framework.Scenes
List linkIDs = new List();
foreach (SceneObjectPart newChild in newSet)
- {
newChild.UpdateFlag = 0;
- linkIDs.Add(newChild.LocalId);
- }
- LinkObjects(null, newRoot.LocalId, linkIDs);
+ LinkObjects(newRoot, newSet);
if (!affectedGroups.Contains(newRoot.ParentGroup))
affectedGroups.Add(newRoot.ParentGroup);
}
--
cgit v1.1