diff options
author | Melanie Thielker | 2009-06-14 21:44:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-06-14 21:44:34 +0000 |
commit | 664dd58cd9a8318c14fc3e3a3950c3e29cf97ba8 (patch) | |
tree | 41db60d59a2f0b46388e1e598679265dafc9d247 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Update svn properties. (diff) | |
download | opensim-SC-664dd58cd9a8318c14fc3e3a3950c3e29cf97ba8.zip opensim-SC-664dd58cd9a8318c14fc3e3a3950c3e29cf97ba8.tar.gz opensim-SC-664dd58cd9a8318c14fc3e3a3950c3e29cf97ba8.tar.bz2 opensim-SC-664dd58cd9a8318c14fc3e3a3950c3e29cf97ba8.tar.xz |
Fixes Mantis #3793 . Committing thomax/Snoopy's patch to allow deeding of objects, with changes:
- Set OwnerID = GroupID for deeded objects.
- Close a security loophole that would have allowed a user with deed rights in a group to deed ANY object to that group, even if it's not owned by them and/or not set to that group
- Set LastOwnerID correctly. Handle objects vs. prims correctly.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 8e3c688..1a40a0d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2682,16 +2682,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2682 | void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs) | 2682 | void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs) |
2683 | { | 2683 | { |
2684 | if (!Permissions.IsGod(remoteClient.AgentId)) | 2684 | if (!Permissions.IsGod(remoteClient.AgentId)) |
2685 | return; | 2685 | { |
2686 | if (ownerID != UUID.Zero) | ||
2687 | return; | ||
2688 | |||
2689 | if (!Permissions.CanDeedObject(remoteClient.AgentId, groupID)) | ||
2690 | return; | ||
2691 | } | ||
2692 | |||
2693 | List<SceneObjectGroup> groups = new List<SceneObjectGroup>(); | ||
2686 | 2694 | ||
2687 | foreach (uint localID in localIDs) | 2695 | foreach (uint localID in localIDs) |
2688 | { | 2696 | { |
2689 | SceneObjectPart part = GetSceneObjectPart(localID); | 2697 | SceneObjectPart part = GetSceneObjectPart(localID); |
2690 | if (part != null && part.ParentGroup != null) | 2698 | if (!groups.Contains(part.ParentGroup)) |
2699 | groups.Add(part.ParentGroup); | ||
2700 | } | ||
2701 | |||
2702 | foreach (SceneObjectGroup sog in groups) | ||
2703 | { | ||
2704 | if (ownerID != null) | ||
2691 | { | 2705 | { |
2692 | part.ParentGroup.SetOwnerId(ownerID); | 2706 | sog.SetOwnerId(ownerID); |
2693 | part.Inventory.ChangeInventoryOwner(ownerID); | 2707 | sog.SetGroup(groupID, remoteClient); |
2694 | part.ParentGroup.SetGroup(groupID, remoteClient); | 2708 | |
2709 | foreach (SceneObjectPart child in sog.Children.Values) | ||
2710 | child.Inventory.ChangeInventoryOwner(ownerID); | ||
2711 | } | ||
2712 | else | ||
2713 | { | ||
2714 | if (!Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)) | ||
2715 | continue; | ||
2716 | |||
2717 | if (sog.GroupID != groupID) | ||
2718 | continue; | ||
2719 | |||
2720 | foreach (SceneObjectPart child in sog.Children.Values) | ||
2721 | { | ||
2722 | child.LastOwnerID = child.OwnerID; | ||
2723 | child.Inventory.ChangeInventoryOwner(groupID); | ||
2724 | } | ||
2725 | |||
2726 | sog.SetOwnerId(groupID); | ||
2695 | } | 2727 | } |
2696 | } | 2728 | } |
2697 | } | 2729 | } |