aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2010-07-15 20:28:18 +0200
committerMelanie Thielker2010-07-15 20:28:18 +0200
commit3f91805afbff1b69ebebcee4ed2593671cf12e12 (patch)
tree422d6fda7119fdade743bf96591e4e02a5b90002
parentFix a few permissions vulnerability. Owners could cause permissions (diff)
downloadopensim-SC_OLD-3f91805afbff1b69ebebcee4ed2593671cf12e12.zip
opensim-SC_OLD-3f91805afbff1b69ebebcee4ed2593671cf12e12.tar.gz
opensim-SC_OLD-3f91805afbff1b69ebebcee4ed2593671cf12e12.tar.bz2
opensim-SC_OLD-3f91805afbff1b69ebebcee4ed2593671cf12e12.tar.xz
prevent hacked viewers from being able to delete arbitrary items from any
prim. Allow friends with perms and shared group members to move or copy things out of prims
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index e1674be..4575068 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -935,6 +935,9 @@ namespace OpenSim.Region.Framework.Scenes
935 } 935 }
936 if (part != null && group != null) 936 if (part != null && group != null)
937 { 937 {
938 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
939 return;
940
938 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 941 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
939 if (item == null) 942 if (item == null)
940 return; 943 return;
@@ -1074,9 +1077,21 @@ namespace OpenSim.Region.Framework.Scenes
1074 return; 1077 return;
1075 } 1078 }
1076 1079
1077 // Only owner can copy 1080 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
1078 if (remoteClient.AgentId != taskItem.OwnerID) 1081 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1079 return; 1082 {
1083 // If the item to be moved is no copy, we need to be able to
1084 // edit the prim.
1085 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
1086 return;
1087 }
1088 else
1089 {
1090 // If the item is copiable, then we just need to have perms
1091 // on it. The delete check is a pure rights check
1092 if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId))
1093 return;
1094 }
1080 1095
1081 MoveTaskInventoryItem(remoteClient, folderId, part, itemId); 1096 MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
1082 } 1097 }