aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-03 21:44:33 +0000
committerMelanie Thielker2008-10-03 21:44:33 +0000
commitab260b5d23da0cf02973583bd869ad8901d63b92 (patch)
treee0c9b068900bc05ef34789bd04fafade85e464ae /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentDisabled some thread aborts in the IRC module that I added earlier and don't ... (diff)
downloadopensim-SC-ab260b5d23da0cf02973583bd869ad8901d63b92.zip
opensim-SC-ab260b5d23da0cf02973583bd869ad8901d63b92.tar.gz
opensim-SC-ab260b5d23da0cf02973583bd869ad8901d63b92.tar.bz2
opensim-SC-ab260b5d23da0cf02973583bd869ad8901d63b92.tar.xz
Fix: Mantis#2326: Fix: privilege escalation through attach from ground
Fix: objects being duplicated inventory on detach. Fix: Mad jumping around of attachments while editing. Fix: Attachments being persisted to database on login. Fix: Attachments being persisted when changed by a script like invisprim refresh. Fix: Attachpoint set, but not reset correctly. Fix: prevent spurious full updates while editing attachments. Several other fixes
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs69
1 files changed, 27 insertions, 42 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 8557b1c..a7bce49 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1684,7 +1684,8 @@ namespace OpenSim.Region.Environment.Scenes
1684 Queue<InventoryFolderImpl> searchfolders = new Queue<InventoryFolderImpl>(); 1684 Queue<InventoryFolderImpl> searchfolders = new Queue<InventoryFolderImpl>();
1685 searchfolders.Enqueue(userInfo.RootFolder); 1685 searchfolders.Enqueue(userInfo.RootFolder);
1686 1686
1687 UUID foundFolder = userInfo.RootFolder.ID; 1687 UUID foundFolder = UUID.Zero;
1688 InventoryItemBase item = null;
1688 1689
1689 // search through folders to find the asset. 1690 // search through folders to find the asset.
1690 while (searchfolders.Count > 0) 1691 while (searchfolders.Count > 0)
@@ -1696,6 +1697,7 @@ namespace OpenSim.Region.Environment.Scenes
1696 { 1697 {
1697 if (fld.Items.ContainsKey(assetID)) 1698 if (fld.Items.ContainsKey(assetID))
1698 { 1699 {
1700 item = fld.Items[assetID];
1699 foundFolder = fld.ID; 1701 foundFolder = fld.ID;
1700 searchfolders.Clear(); 1702 searchfolders.Clear();
1701 break; 1703 break;
@@ -1711,49 +1713,30 @@ namespace OpenSim.Region.Environment.Scenes
1711 } 1713 }
1712 } 1714 }
1713 1715
1714 AssetBase asset = CreateAsset( 1716 if (foundFolder != UUID.Zero && item != null)
1715 objectGroup.GetPartName(objectGroup.LocalId),
1716 objectGroup.GetPartDescription(objectGroup.LocalId),
1717 (sbyte)AssetType.Object,
1718 Utils.StringToBytes(sceneObjectXml));
1719 AssetCache.AddAsset(asset);
1720
1721 InventoryItemBase item = new InventoryItemBase();
1722 item.Creator = objectGroup.RootPart.CreatorID;
1723 item.Owner = agentID;
1724 item.ID = assetID;
1725 item.AssetID = asset.FullID;
1726 item.Description = asset.Description;
1727 item.Name = asset.Name;
1728 item.AssetType = asset.Type;
1729 item.InvType = (int)InventoryType.Object;
1730
1731 // Sticking it in root folder for now.. objects folder later?
1732
1733 item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID;
1734 if ((agentID != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1735 {
1736 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1737 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1738 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1739 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1740 }
1741 else
1742 { 1717 {
1743 item.BasePermissions = objectGroup.GetEffectivePermissions(); 1718 AssetBase asset = CreateAsset(
1744 item.CurrentPermissions = objectGroup.GetEffectivePermissions(); 1719 objectGroup.GetPartName(objectGroup.LocalId),
1745 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1720 objectGroup.GetPartDescription(objectGroup.LocalId),
1746 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1721 (sbyte)AssetType.Object,
1747 } 1722 Utils.StringToBytes(sceneObjectXml));
1723 AssetCache.AddAsset(asset);
1748 1724
1749 userInfo.AddItem(item); 1725 item.AssetID = asset.FullID;
1726 item.Description = asset.Description;
1727 item.Name = asset.Name;
1728 item.AssetType = asset.Type;
1729 item.InvType = (int)InventoryType.Object;
1730 item.Folder = foundFolder;
1750 1731
1751 // this gets called when the agent loggs off! 1732 userInfo.UpdateItem(item);
1752 if (remoteClient != null)
1753 {
1754 remoteClient.SendInventoryItemCreateUpdate(item);
1755 }
1756 1733
1734 // this gets called when the agent loggs off!
1735 if (remoteClient != null)
1736 {
1737 remoteClient.SendInventoryItemCreateUpdate(item);
1738 }
1739 }
1757 } 1740 }
1758 } 1741 }
1759 } 1742 }
@@ -1786,9 +1769,8 @@ namespace OpenSim.Region.Environment.Scenes
1786 item.AssetType = asset.Type; 1769 item.AssetType = asset.Type;
1787 item.InvType = (int)InventoryType.Object; 1770 item.InvType = (int)InventoryType.Object;
1788 1771
1789 // Sticking it in root folder for now.. objects folder later? 1772 item.Folder = UUID.Zero; // Objects folder!
1790 1773
1791 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID;
1792 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 1774 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1793 { 1775 {
1794 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1776 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
@@ -1805,8 +1787,11 @@ namespace OpenSim.Region.Environment.Scenes
1805 } 1787 }
1806 item.CreationDate = Util.UnixTimeSinceEpoch(); 1788 item.CreationDate = Util.UnixTimeSinceEpoch();
1807 1789
1790 grp.SetFromAssetID(item.ID);
1791
1808 userInfo.AddItem(item); 1792 userInfo.AddItem(item);
1809 remoteClient.SendInventoryItemCreateUpdate(item); 1793 remoteClient.SendInventoryItemCreateUpdate(item);
1794
1810 return item.AssetID; 1795 return item.AssetID;
1811 } 1796 }
1812 return UUID.Zero; 1797 return UUID.Zero;