aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-06 17:05:00 +0000
committerMelanie Thielker2017-01-06 17:05:00 +0000
commite526e8c5e225e931a5796532bf32b76530388089 (patch)
tree5673c473bef1e72550c2ef7c8bdfaf400a2fd908 /OpenSim/Region
parentRemove more calls to that horrible function (diff)
downloadopensim-SC-e526e8c5e225e931a5796532bf32b76530388089.zip
opensim-SC-e526e8c5e225e931a5796532bf32b76530388089.tar.gz
opensim-SC-e526e8c5e225e931a5796532bf32b76530388089.tar.bz2
opensim-SC-e526e8c5e225e931a5796532bf32b76530388089.tar.xz
Fix the long-standing bug that object permissions set in inventory were lost
NOTE: Items rezzed by users using 0.8 or older will still exhibit broken behaviour. Until 0.8 becomes end of life, this fix will not produce dependable results on grids with mixed versions. Grids based on 0.9 will now work properly.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs1
3 files changed, 21 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index aa5d381..0104823 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1141,6 +1141,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1141 part.OwnerID = item.Owner; 1141 part.OwnerID = item.Owner;
1142 part.RezzerID = item.Owner; 1142 part.RezzerID = item.Owner;
1143 part.Inventory.ChangeInventoryOwner(item.Owner); 1143 part.Inventory.ChangeInventoryOwner(item.Owner);
1144
1145 // This applies the base mask from the item as the next
1146 // permissions for the object. This is correct because the
1147 // giver's base mask was masked by the giver's next owner
1148 // mask, so the base mask equals the original next owner mask.
1149 part.NextOwnerMask = item.BasePermissions;
1144 } 1150 }
1145 1151
1146 so.ApplyNextOwnerPermissions(); 1152 so.ApplyNextOwnerPermissions();
@@ -1152,10 +1158,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1152 { 1158 {
1153 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) 1159 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
1154 { 1160 {
1155 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) 1161 part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
1156 part.EveryoneMask = item.EveryOnePermissions & part.BaseMask; 1162 part.NextOwnerMask = item.NextPermissions & part.BaseMask;
1157 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
1158 part.NextOwnerMask = item.NextPermissions & part.BaseMask;
1159 } 1163 }
1160 } 1164 }
1161 } 1165 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 9c8dbb6..cb06540 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -627,6 +627,7 @@ namespace OpenSim.Region.Framework.Scenes
627 itemCopy.AssetType = item.AssetType; 627 itemCopy.AssetType = item.AssetType;
628 itemCopy.InvType = item.InvType; 628 itemCopy.InvType = item.InvType;
629 itemCopy.Folder = recipientFolderId; 629 itemCopy.Folder = recipientFolderId;
630 itemCopy.Flags = item.Flags;
630 631
631 if (Permissions.PropagatePermissions() && recipient != senderId) 632 if (Permissions.PropagatePermissions() && recipient != senderId)
632 { 633 {
@@ -643,7 +644,7 @@ namespace OpenSim.Region.Framework.Scenes
643 // 644 //
644 // Transfer 645 // Transfer
645 // Copy 646 // Copy
646 // Modufy 647 // Modify
647 uint permsMask = ~ ((uint)PermissionMask.Copy | 648 uint permsMask = ~ ((uint)PermissionMask.Copy |
648 (uint)PermissionMask.Transfer | 649 (uint)PermissionMask.Transfer |
649 (uint)PermissionMask.Modify); 650 (uint)PermissionMask.Modify);
@@ -718,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes
718 itemCopy.BasePermissions = basePerms; 719 itemCopy.BasePermissions = basePerms;
719 itemCopy.CurrentPermissions = ownerPerms; 720 itemCopy.CurrentPermissions = ownerPerms;
720 itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; 721 itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
722 // Need to clear the other inventory slam options.
723 // That is so we can handle the case where the recipient
724 // changes the bits in inventory before rezzing
725 itemCopy.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
721 726
722 itemCopy.NextPermissions = item.NextPermissions; 727 itemCopy.NextPermissions = item.NextPermissions;
723 728
@@ -767,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes
767 772
768 itemCopy.GroupID = UUID.Zero; 773 itemCopy.GroupID = UUID.Zero;
769 itemCopy.GroupOwned = false; 774 itemCopy.GroupOwned = false;
770 itemCopy.Flags = item.Flags; 775 itemCopy.SalePrice = 0; //item.SalePrice;
771 itemCopy.SalePrice = item.SalePrice; 776 itemCopy.SaleType = 0; //item.SaleType;
772 itemCopy.SaleType = item.SaleType;
773 777
774 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 778 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
775 if (invAccess != null) 779 if (invAccess != null)
@@ -1251,9 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes
1251 agentItem.CurrentPermissions = agentItem.BasePermissions; 1255 agentItem.CurrentPermissions = agentItem.BasePermissions;
1252 1256
1253 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; 1257 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1258 agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
1254 agentItem.NextPermissions = taskItem.NextPermissions; 1259 agentItem.NextPermissions = taskItem.NextPermissions;
1255 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1260 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1256 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 1261 // Group permissions make no sense here
1262 agentItem.GroupPermissions = 0;
1257 } 1263 }
1258 else 1264 else
1259 { 1265 {
@@ -1261,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes
1261 agentItem.CurrentPermissions = taskItem.CurrentPermissions; 1267 agentItem.CurrentPermissions = taskItem.CurrentPermissions;
1262 agentItem.NextPermissions = taskItem.NextPermissions; 1268 agentItem.NextPermissions = taskItem.NextPermissions;
1263 agentItem.EveryOnePermissions = taskItem.EveryonePermissions; 1269 agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
1264 agentItem.GroupPermissions = taskItem.GroupPermissions; 1270 agentItem.GroupPermissions = 0;
1265 } 1271 }
1266 1272
1267 message = null; 1273 message = null;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b97cceb..99be06b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -5242,6 +5242,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
5242 BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; 5242 BaseMask &= NextOwnerMask | (uint)PermissionMask.Export;
5243 OwnerMask &= NextOwnerMask; 5243 OwnerMask &= NextOwnerMask;
5244 EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; 5244 EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export;
5245 GroupMask = 0; // Giving an object zaps group permissions
5245 5246
5246 Inventory.ApplyNextOwnerPermissions(); 5247 Inventory.ApplyNextOwnerPermissions();
5247 } 5248 }