From fb86e415615ddfd917485daf5e4a4f2f0486359f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 14 Jan 2017 14:19:58 +0000 Subject: [PATCH] fix incoerent definition of Slam bit (bits 3 and 4 used in diferent places.) this may still be wrong on other places; Do not loose folded permitions, WARNING MASTER IS NOW UNSTABLE. permissions are still broken" --- OpenSim/Framework/Util.cs | 5 +++-- .../InventoryAccess/InventoryAccessModule.cs | 11 +++++++---- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 6c0142e567..2ede363f7b 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -66,9 +66,10 @@ namespace OpenSim.Framework FoldedTransfer = 1, FoldedModify = 1 << 1, FoldedCopy = 1 << 2, - FoldedExport = 1 << 4, + FoldedExport = 1 << 3, + Slam = 1 << 4, - FoldedMask = 0x17, + FoldedMask = 0x0f, // Transfer = 1 << 13, diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f8a2c2e0a5..6fe7e896ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -605,15 +605,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess perms &= ~(uint)PermissionMask.Transfer; if ((nextPerms & (uint)PermissionMask.Modify) == 0) perms &= ~(uint)PermissionMask.Modify; - - item.BasePermissions = perms & so.RootPart.NextOwnerMask; + +// item.BasePermissions = perms & so.RootPart.NextOwnerMask; + + uint nextp = so.RootPart.NextOwnerMask | 0x0f; + item.BasePermissions = perms & nextp; item.CurrentPermissions = item.BasePermissions; item.NextPermissions = perms & so.RootPart.NextOwnerMask; item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; // apply next owner perms on rez - item.CurrentPermissions |= SceneObjectGroup.SLAM; + item.CurrentPermissions |= (uint)PermissionMask.Slam; } else { @@ -1124,7 +1127,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // rootPart.OwnerID, item.Owner, item.CurrentPermissions); if ((rootPart.OwnerID != item.Owner) || - (item.CurrentPermissions & 8) != 0 || + (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) { //Need to kill the for sale here diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index bf991c691d..3f531bee86 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -117,9 +117,6 @@ namespace OpenSim.Region.Framework.Scenes NOT_STATUS_ROTATE_Z = 0xF7 } - // This flag has the same purpose as InventoryItemFlags.ObjectSlamPerm - public static readonly uint SLAM = 16; - // private PrimCountTaintedDelegate handlerPrimCountTainted = null; /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b8ac089826..557b55ed97 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5181,7 +5181,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter /// The scene the prim is being rezzed into public void ApplyPermissionsOnRez(InventoryItemBase item, bool userInventory, Scene scene) { - if ((OwnerID != item.Owner) || ((item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) || ((item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)) + if ((OwnerID != item.Owner) || ((item.CurrentPermissions & (uint)PermissionMask.Slam) != 0) || ((item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)) { if (scene.Permissions.PropagatePermissions()) {