aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-01-06 17:33:41 +0000
committerUbitUmarov2017-01-06 17:33:41 +0000
commitfba2466c16ebb15e15880567db565fecd2f30d7c (patch)
treeca6b670c91bd1e5915226b90a10c017997db9e4e /OpenSim/Region
parentadd a missing god_date transmition (diff)
parentMerge branch 'master' of opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-fba2466c16ebb15e15880567db565fecd2f30d7c.zip
opensim-SC-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.gz
opensim-SC-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.bz2
opensim-SC-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.xz
Merge branch 'master' of opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs46
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs42
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs19
5 files changed, 61 insertions, 55 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index fcf373b..0104823 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -532,17 +532,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
532 } 532 }
533 else 533 else
534 { 534 {
535 AddPermissions(item, objlist[0], objlist, remoteClient);
536
535 item.CreationDate = Util.UnixTimeSinceEpoch(); 537 item.CreationDate = Util.UnixTimeSinceEpoch();
536 item.Description = asset.Description; 538 item.Description = asset.Description;
537 item.Name = asset.Name; 539 item.Name = asset.Name;
538 item.AssetType = asset.Type; 540 item.AssetType = asset.Type;
539 541
540 //preserve perms on return
541 if(DeRezAction.Return == action)
542 AddPermissions(item, objlist[0], objlist, null);
543 else
544 AddPermissions(item, objlist[0], objlist, remoteClient);
545
546 m_Scene.AddInventoryItem(item); 542 m_Scene.AddInventoryItem(item);
547 543
548 if (remoteClient != null && item.Owner == remoteClient.AgentId) 544 if (remoteClient != null && item.Owner == remoteClient.AgentId)
@@ -599,15 +595,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
599 } 595 }
600 effectivePerms |= (uint)PermissionMask.Move; 596 effectivePerms |= (uint)PermissionMask.Move;
601 597
602 //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
603
604 if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) 598 if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
605 { 599 {
606 // Changing ownership, so apply the "Next Owner" permissions to all of the
607 // inventory item's permissions.
608
609 uint perms = effectivePerms; 600 uint perms = effectivePerms;
610 PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); 601 uint nextPerms = (perms & 7) << 13;
602 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
603 perms &= ~(uint)PermissionMask.Copy;
604 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
605 perms &= ~(uint)PermissionMask.Transfer;
606 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
607 perms &= ~(uint)PermissionMask.Modify;
611 608
612 item.BasePermissions = perms & so.RootPart.NextOwnerMask; 609 item.BasePermissions = perms & so.RootPart.NextOwnerMask;
613 item.CurrentPermissions = item.BasePermissions; 610 item.CurrentPermissions = item.BasePermissions;
@@ -620,13 +617,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
620 } 617 }
621 else 618 else
622 { 619 {
623 // Not changing ownership.
624 // In this case we apply the permissions in the object's items ONLY to the inventory
625 // item's "Next Owner" permissions, but NOT to its "Current", "Base", etc. permissions.
626 // E.g., if the object contains a No-Transfer item then the item's "Next Owner"
627 // permissions are also No-Transfer.
628 PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref allObjectsNextOwnerPerms);
629
630 item.BasePermissions = effectivePerms; 620 item.BasePermissions = effectivePerms;
631 item.CurrentPermissions = effectivePerms; 621 item.CurrentPermissions = effectivePerms;
632 item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms; 622 item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms;
@@ -640,10 +630,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
640 (uint)PermissionMask.Move | 630 (uint)PermissionMask.Move |
641 (uint)PermissionMask.Export | 631 (uint)PermissionMask.Export |
642 7); // Preserve folded permissions 632 7); // Preserve folded permissions
643 } 633 }
644 634
645 //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
646
647 return item; 635 return item;
648 } 636 }
649 637
@@ -1153,6 +1141,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1153 part.OwnerID = item.Owner; 1141 part.OwnerID = item.Owner;
1154 part.RezzerID = item.Owner; 1142 part.RezzerID = item.Owner;
1155 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;
1156 } 1150 }
1157 1151
1158 so.ApplyNextOwnerPermissions(); 1152 so.ApplyNextOwnerPermissions();
@@ -1164,10 +1158,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1164 { 1158 {
1165 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) 1159 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
1166 { 1160 {
1167 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) 1161 part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
1168 part.EveryoneMask = item.EveryOnePermissions & part.BaseMask; 1162 part.NextOwnerMask = item.NextPermissions & part.BaseMask;
1169 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
1170 part.NextOwnerMask = item.NextPermissions & part.BaseMask;
1171 } 1163 }
1172 } 1164 }
1173 } 1165 }
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index b7f01be..2837358 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -211,7 +211,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
211 item.InvType = (int)InventoryType.Object; 211 item.InvType = (int)InventoryType.Object;
212 item.Folder = categoryID; 212 item.Folder = categoryID;
213 213
214 PermissionsUtil.ApplyFoldedPermissions(perms, ref perms); 214 uint nextPerms=(perms & 7) << 13;
215 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
216 perms &= ~(uint)PermissionMask.Copy;
217 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
218 perms &= ~(uint)PermissionMask.Transfer;
219 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
220 perms &= ~(uint)PermissionMask.Modify;
215 221
216 item.BasePermissions = perms & part.NextOwnerMask; 222 item.BasePermissions = perms & part.NextOwnerMask;
217 item.CurrentPermissions = perms & part.NextOwnerMask; 223 item.CurrentPermissions = perms & part.NextOwnerMask;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index e3ccf96..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);
@@ -681,13 +682,17 @@ namespace OpenSim.Region.Framework.Scenes
681 // a mask 682 // a mask
682 if (item.InvType == (int)InventoryType.Object) 683 if (item.InvType == (int)InventoryType.Object)
683 { 684 {
685 // Create a safe mask for the current perms
686 uint foldedPerms = (item.CurrentPermissions & 7) << 13;
687 foldedPerms |= permsMask;
688
684 bool isRootMod = (item.CurrentPermissions & 689 bool isRootMod = (item.CurrentPermissions &
685 (uint)PermissionMask.Modify) != 0 ? 690 (uint)PermissionMask.Modify) != 0 ?
686 true : false; 691 true : false;
687 692
688 // Mask the owner perms to the folded perms 693 // Mask the owner perms to the folded perms
689 PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms); 694 ownerPerms &= foldedPerms;
690 PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms); 695 basePerms &= foldedPerms;
691 696
692 // If the root was mod, let the mask reflect that 697 // If the root was mod, let the mask reflect that
693 // We also need to adjust the base here, because 698 // We also need to adjust the base here, because
@@ -714,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes
714 itemCopy.BasePermissions = basePerms; 719 itemCopy.BasePermissions = basePerms;
715 itemCopy.CurrentPermissions = ownerPerms; 720 itemCopy.CurrentPermissions = ownerPerms;
716 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);
717 726
718 itemCopy.NextPermissions = item.NextPermissions; 727 itemCopy.NextPermissions = item.NextPermissions;
719 728
@@ -763,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes
763 772
764 itemCopy.GroupID = UUID.Zero; 773 itemCopy.GroupID = UUID.Zero;
765 itemCopy.GroupOwned = false; 774 itemCopy.GroupOwned = false;
766 itemCopy.Flags = item.Flags; 775 itemCopy.SalePrice = 0; //item.SalePrice;
767 itemCopy.SalePrice = item.SalePrice; 776 itemCopy.SaleType = 0; //item.SaleType;
768 itemCopy.SaleType = item.SaleType;
769 777
770 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 778 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
771 if (invAccess != null) 779 if (invAccess != null)
@@ -1240,26 +1248,18 @@ namespace OpenSim.Region.Framework.Scenes
1240 { 1248 {
1241 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1249 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1242 if (taskItem.InvType == (int)InventoryType.Object) 1250 if (taskItem.InvType == (int)InventoryType.Object)
1243 { 1251 agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
1244 // Bake the new base permissions from folded permissions 1252 else
1245 // The folded perms are in the lowest 3 bits of the current perms 1253 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
1246 // We use base permissions here to avoid baking the "Locked" status
1247 // into the item as it is passed.
1248 uint perms = taskItem.BasePermissions & taskItem.NextPermissions;
1249 PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms);
1250 // Avoid the "lock trap" - move must always be enabled but the above may remove it
1251 // Add it back here.
1252 agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
1253 // Newly given items cannot be "locked" on rez. Make sure by
1254 // setting current equal to base.
1255 }
1256 1254
1257 agentItem.CurrentPermissions = agentItem.BasePermissions; 1255 agentItem.CurrentPermissions = agentItem.BasePermissions;
1258 1256
1259 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);
1260 agentItem.NextPermissions = taskItem.NextPermissions; 1259 agentItem.NextPermissions = taskItem.NextPermissions;
1261 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1260 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1262 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 1261 // Group permissions make no sense here
1262 agentItem.GroupPermissions = 0;
1263 } 1263 }
1264 else 1264 else
1265 { 1265 {
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes
1267 agentItem.CurrentPermissions = taskItem.CurrentPermissions; 1267 agentItem.CurrentPermissions = taskItem.CurrentPermissions;
1268 agentItem.NextPermissions = taskItem.NextPermissions; 1268 agentItem.NextPermissions = taskItem.NextPermissions;
1269 agentItem.EveryOnePermissions = taskItem.EveryonePermissions; 1269 agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
1270 agentItem.GroupPermissions = taskItem.GroupPermissions; 1270 agentItem.GroupPermissions = 0;
1271 } 1271 }
1272 1272
1273 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 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index a50f162..45c3ebd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1358,12 +1358,19 @@ namespace OpenSim.Region.Framework.Scenes
1358 { 1358 {
1359 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) 1359 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
1360 { 1360 {
1361 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) 1361// m_log.DebugFormat (
1362 item.CurrentPermissions &= ~(uint)PermissionMask.Copy; 1362// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
1363 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) 1363// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
1364 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; 1364
1365 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) 1365 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
1366 item.CurrentPermissions &= ~(uint)PermissionMask.Modify; 1366 {
1367 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
1368 item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
1369 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
1370 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
1371 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
1372 item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
1373 }
1367 } 1374 }
1368 item.CurrentPermissions &= item.NextPermissions; 1375 item.CurrentPermissions &= item.NextPermissions;
1369 item.BasePermissions &= item.NextPermissions; 1376 item.BasePermissions &= item.NextPermissions;