diff options
author | Melanie | 2010-04-30 11:46:50 +0100 |
---|---|---|
committer | Melanie | 2010-04-30 11:46:50 +0100 |
commit | 22b32171130b557dd83df218a38629589c7cc570 (patch) | |
tree | 6aca2861ae3657ba0ca7a960cd5f8af025a2d889 /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | Started redoing HGInventoryBroker for XInventory and with multi-protocol in m... (diff) | |
download | opensim-SC_OLD-22b32171130b557dd83df218a38629589c7cc570.zip opensim-SC_OLD-22b32171130b557dd83df218a38629589c7cc570.tar.gz opensim-SC_OLD-22b32171130b557dd83df218a38629589c7cc570.tar.bz2 opensim-SC_OLD-22b32171130b557dd83df218a38629589c7cc570.tar.xz |
Fix link security issue
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1421d0e..ce11267 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1463,20 +1463,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1463 | /// <param name="client"></param> | 1463 | /// <param name="client"></param> |
1464 | /// <param name="parentPrim"></param> | 1464 | /// <param name="parentPrim"></param> |
1465 | /// <param name="childPrims"></param> | 1465 | /// <param name="childPrims"></param> |
1466 | protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) | 1466 | protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) |
1467 | { | 1467 | { |
1468 | Monitor.Enter(m_updateLock); | 1468 | Monitor.Enter(m_updateLock); |
1469 | try | 1469 | try |
1470 | { | 1470 | { |
1471 | SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); | 1471 | SceneObjectGroup parentGroup = root.ParentGroup; |
1472 | 1472 | ||
1473 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); | 1473 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); |
1474 | if (parentGroup != null) | 1474 | if (parentGroup != null) |
1475 | { | 1475 | { |
1476 | // We do this in reverse to get the link order of the prims correct | 1476 | // We do this in reverse to get the link order of the prims correct |
1477 | for (int i = childPrimIds.Count - 1; i >= 0; i--) | 1477 | for (int i = children.Count - 1; i >= 0; i--) |
1478 | { | 1478 | { |
1479 | SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); | 1479 | SceneObjectGroup child = children[i].ParentGroup; |
1480 | |||
1480 | if (child != null) | 1481 | if (child != null) |
1481 | { | 1482 | { |
1482 | // Make sure no child prim is set for sale | 1483 | // Make sure no child prim is set for sale |
@@ -1509,17 +1510,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1509 | parentGroup.HasGroupChanged = true; | 1510 | parentGroup.HasGroupChanged = true; |
1510 | parentGroup.ScheduleGroupForFullUpdate(); | 1511 | parentGroup.ScheduleGroupForFullUpdate(); |
1511 | 1512 | ||
1512 | // if (client != null) | ||
1513 | // { | ||
1514 | // parentGroup.GetProperties(client); | ||
1515 | // } | ||
1516 | // else | ||
1517 | // { | ||
1518 | // foreach (ScenePresence p in GetScenePresences()) | ||
1519 | // { | ||
1520 | // parentGroup.GetProperties(p.ControllingClient); | ||
1521 | // } | ||
1522 | // } | ||
1523 | } | 1513 | } |
1524 | finally | 1514 | finally |
1525 | { | 1515 | { |
@@ -1531,12 +1521,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1531 | /// Delink a linkset | 1521 | /// Delink a linkset |
1532 | /// </summary> | 1522 | /// </summary> |
1533 | /// <param name="prims"></param> | 1523 | /// <param name="prims"></param> |
1534 | protected internal void DelinkObjects(List<uint> primIds) | 1524 | protected internal void DelinkObjects(List<SceneObjectPart> prims) |
1535 | { | ||
1536 | DelinkObjects(primIds, true); | ||
1537 | } | ||
1538 | |||
1539 | protected internal void DelinkObjects(List<uint> primIds, bool sendEvents) | ||
1540 | { | 1525 | { |
1541 | Monitor.Enter(m_updateLock); | 1526 | Monitor.Enter(m_updateLock); |
1542 | try | 1527 | try |
@@ -1546,9 +1531,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1546 | List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); | 1531 | List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); |
1547 | // Look them all up in one go, since that is comparatively expensive | 1532 | // Look them all up in one go, since that is comparatively expensive |
1548 | // | 1533 | // |
1549 | foreach (uint primID in primIds) | 1534 | foreach (SceneObjectPart part in prims) |
1550 | { | 1535 | { |
1551 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); | ||
1552 | if (part != null) | 1536 | if (part != null) |
1553 | { | 1537 | { |
1554 | if (part.ParentGroup.Children.Count != 1) // Skip single | 1538 | if (part.ParentGroup.Children.Count != 1) // Skip single |
@@ -1563,17 +1547,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1563 | affectedGroups.Add(group); | 1547 | affectedGroups.Add(group); |
1564 | } | 1548 | } |
1565 | } | 1549 | } |
1566 | else | ||
1567 | { | ||
1568 | m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); | ||
1569 | } | ||
1570 | } | 1550 | } |
1571 | 1551 | ||
1572 | foreach (SceneObjectPart child in childParts) | 1552 | foreach (SceneObjectPart child in childParts) |
1573 | { | 1553 | { |
1574 | // Unlink all child parts from their groups | 1554 | // Unlink all child parts from their groups |
1575 | // | 1555 | // |
1576 | child.ParentGroup.DelinkFromGroup(child, sendEvents); | 1556 | child.ParentGroup.DelinkFromGroup(child, true); |
1577 | } | 1557 | } |
1578 | 1558 | ||
1579 | foreach (SceneObjectPart root in rootParts) | 1559 | foreach (SceneObjectPart root in rootParts) |
@@ -1628,12 +1608,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1628 | List<uint> linkIDs = new List<uint>(); | 1608 | List<uint> linkIDs = new List<uint>(); |
1629 | 1609 | ||
1630 | foreach (SceneObjectPart newChild in newSet) | 1610 | foreach (SceneObjectPart newChild in newSet) |
1631 | { | ||
1632 | newChild.UpdateFlag = 0; | 1611 | newChild.UpdateFlag = 0; |
1633 | linkIDs.Add(newChild.LocalId); | ||
1634 | } | ||
1635 | 1612 | ||
1636 | LinkObjects(null, newRoot.LocalId, linkIDs); | 1613 | LinkObjects(newRoot, newSet); |
1637 | if (!affectedGroups.Contains(newRoot.ParentGroup)) | 1614 | if (!affectedGroups.Contains(newRoot.ParentGroup)) |
1638 | affectedGroups.Add(newRoot.ParentGroup); | 1615 | affectedGroups.Add(newRoot.ParentGroup); |
1639 | } | 1616 | } |