aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs32
2 files changed, 54 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 386aab4..cbe3456 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -397,29 +397,31 @@ namespace OpenSim.Region.Framework.Scenes
397 itemCopy.InvType = item.InvType; 397 itemCopy.InvType = item.InvType;
398 itemCopy.Folder = recipientFolderId; 398 itemCopy.Folder = recipientFolderId;
399 399
400 if (Permissions.PropagatePermissions()) 400 if (Permissions.PropagatePermissions() && recipient != senderId)
401 { 401 {
402 // First, make sore base is limited to the next perms
403 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
404 // By default, current equals base
405 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
406
407 // If this is an object, replace current perms
408 // with folded perms
402 if (item.InvType == (int)InventoryType.Object) 409 if (item.InvType == (int)InventoryType.Object)
403 { 410 {
404 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); 411 itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
405 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; 412 itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
406 }
407 else
408 {
409 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
410 } 413 }
411 414
412 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 415 // Ensure there is no escalation
413 if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit 416 itemCopy.CurrentPermissions &= item.NextPermissions;
414 { 417
415 itemCopy.BasePermissions &= item.NextPermissions; 418 // Need slam bit on xfer
416 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 419 itemCopy.CurrentPermissions |= 8;
417 itemCopy.CurrentPermissions |= 8;
418 }
419 420
420 itemCopy.NextPermissions = item.NextPermissions; 421 itemCopy.NextPermissions = item.NextPermissions;
421 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 422
422 itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; 423 itemCopy.EveryOnePermissions = 0;
424 itemCopy.GroupPermissions = 0;
423 } 425 }
424 else 426 else
425 { 427 {
@@ -914,12 +916,12 @@ namespace OpenSim.Region.Framework.Scenes
914 916
915 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 917 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
916 { 918 {
919 agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
917 if (taskItem.InvType == (int)InventoryType.Object) 920 if (taskItem.InvType == (int)InventoryType.Object)
918 agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); 921 agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
919 else 922 agentItem.CurrentPermissions = agentItem.BasePermissions ;
920 agentItem.BasePermissions = taskItem.BasePermissions; 923
921 agentItem.BasePermissions &= taskItem.NextPermissions; 924 agentItem.CurrentPermissions |= 8;
922 agentItem.CurrentPermissions = agentItem.BasePermissions | 8;
923 agentItem.NextPermissions = taskItem.NextPermissions; 925 agentItem.NextPermissions = taskItem.NextPermissions;
924 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; 926 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
925 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 927 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c89f656..ad66273 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -888,13 +888,43 @@ namespace OpenSim.Region.Framework.Scenes
888 if (land != null) 888 if (land != null)
889 { 889 {
890 //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. 890 //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
891 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_userLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) 891 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && UserLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
892 { 892 {
893 pos = land.LandData.UserLocation; 893 pos = land.LandData.UserLocation;
894 } 894 }
895 } 895 }
896 } 896 }
897 897
898 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
899 {
900 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
901
902 if (pos.X < 0)
903 {
904 emergencyPos.X = (int)Constants.RegionSize + pos.X;
905 if (!(pos.Y < 0))
906 emergencyPos.Y = pos.Y;
907 if (!(pos.Z < 0))
908 emergencyPos.Z = pos.Z;
909 }
910 if (pos.Y < 0)
911 {
912 emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
913 if (!(pos.X < 0))
914 emergencyPos.X = pos.X;
915 if (!(pos.Z < 0))
916 emergencyPos.Z = pos.Z;
917 }
918 if (pos.Z < 0)
919 {
920 emergencyPos.Z = 128;
921 if (!(pos.Y < 0))
922 emergencyPos.Y = pos.Y;
923 if (!(pos.X < 0))
924 emergencyPos.X = pos.X;
925 }
926 }
927
898 if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f) 928 if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f)
899 { 929 {
900 m_log.WarnFormat( 930 m_log.WarnFormat(