aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs112
1 files changed, 88 insertions, 24 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 37929f2..ec238ef 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -662,8 +662,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
662 public void ProcessSpecificPacketAsync(object state) 662 public void ProcessSpecificPacketAsync(object state)
663 { 663 {
664 AsyncPacketProcess packetObject = (AsyncPacketProcess)state; 664 AsyncPacketProcess packetObject = (AsyncPacketProcess)state;
665 packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); 665 packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack);
666
667 } 666 }
668 667
669 #endregion Packet Handling 668 #endregion Packet Handling
@@ -7092,32 +7091,89 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7092 taskID = new UUID(transfer.TransferInfo.Params, 48); 7091 taskID = new UUID(transfer.TransferInfo.Params, 48);
7093 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 7092 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7094 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 7093 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7094
7095// m_log.DebugFormat(
7096// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7097// requestID, itemID, taskID, Name);
7098
7095 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7099 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
7096 { 7100 {
7097 if (taskID != UUID.Zero) // Prim 7101 if (taskID != UUID.Zero) // Prim
7098 { 7102 {
7099 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); 7103 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
7100 if (part == null) 7104 if (part == null)
7105 {
7106 m_log.WarnFormat(
7107 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7108 Name, requestID, itemID, taskID);
7101 return true; 7109 return true;
7110 }
7102 7111
7103 if (part.OwnerID != AgentId) 7112 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7104 return true; 7113 if (tii == null)
7105 7114 {
7106 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 7115 m_log.WarnFormat(
7107 return true; 7116 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7108 7117 Name, requestID, itemID, taskID);
7109 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
7110 if (ti == null)
7111 return true;
7112
7113 if (ti.OwnerID != AgentId)
7114 return true;
7115
7116 if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7117 return true;
7118
7119 if (ti.AssetID != requestID)
7120 return true; 7118 return true;
7119 }
7120
7121 if (tii.Type == (int)AssetType.LSLText)
7122 {
7123 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7124 return true;
7125 }
7126 else if (tii.Type == (int)AssetType.Notecard)
7127 {
7128 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7129 return true;
7130 }
7131 else
7132 {
7133 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7134 // shared with group. In fact, all this permissions checking should move to an IPermissionsModule
7135 if (part.OwnerID != AgentId)
7136 {
7137 m_log.WarnFormat(
7138 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7139 Name, requestID, itemID, taskID, part.OwnerID);
7140 return true;
7141 }
7142
7143 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7144 {
7145 m_log.WarnFormat(
7146 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7147 Name, requestID, itemID, taskID);
7148 return true;
7149 }
7150
7151 if (tii.OwnerID != AgentId)
7152 {
7153 m_log.WarnFormat(
7154 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7155 Name, requestID, itemID, taskID, tii.OwnerID);
7156 return true;
7157 }
7158
7159 if ((
7160 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7161 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7162 {
7163 m_log.WarnFormat(
7164 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7165 Name, requestID, itemID, taskID);
7166 return true;
7167 }
7168
7169 if (tii.AssetID != requestID)
7170 {
7171 m_log.WarnFormat(
7172 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
7173 Name, requestID, itemID, taskID, tii.AssetID);
7174 return true;
7175 }
7176 }
7121 } 7177 }
7122 else // Agent 7178 else // Agent
7123 { 7179 {
@@ -7153,7 +7209,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7153 } 7209 }
7154 7210
7155 if (assetRequestItem.AssetID != requestID) 7211 if (assetRequestItem.AssetID != requestID)
7212 {
7213 m_log.WarnFormat(
7214 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7215 Name, requestID, itemID, assetRequestItem.AssetID);
7156 return true; 7216 return true;
7217 }
7157 } 7218 }
7158 } 7219 }
7159 } 7220 }
@@ -7700,12 +7761,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7700 newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; 7761 newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask;
7701 newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; 7762 newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask;
7702 newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; 7763 newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask;
7764
7765 // Unused? Clicking share with group sets GroupPermissions instead, so perhaps this is something
7766 // different
7703 //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; 7767 //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned;
7704 newTaskItem.Type = updatetask.InventoryData.Type; 7768 newTaskItem.Type = updatetask.InventoryData.Type;
7705 newTaskItem.InvType = updatetask.InventoryData.InvType; 7769 newTaskItem.InvType = updatetask.InventoryData.InvType;
7706 newTaskItem.Flags = updatetask.InventoryData.Flags; 7770 newTaskItem.Flags = updatetask.InventoryData.Flags;
7707 //newTaskItem.SaleType=updatetask.InventoryData.SaleType; 7771 //newTaskItem.SaleType=updatetask.InventoryData.SaleType;
7708 //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; 7772 //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;
7709 newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); 7773 newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name);
7710 newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); 7774 newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description);
7711 newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; 7775 newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate;
@@ -7713,7 +7777,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7713 newTaskItem, updatetask.UpdateData.LocalID); 7777 newTaskItem, updatetask.UpdateData.LocalID);
7714 } 7778 }
7715 } 7779 }
7716 } 7780 }
7717 7781
7718 return true; 7782 return true;
7719 } 7783 }
@@ -11346,8 +11410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11346 // } 11410 // }
11347 } 11411 }
11348 11412
11349 //check to see if asset is in local cache, if not we need to request it from asset server. 11413// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11350 //m_log.Debug("asset request " + requestID);
11351 11414
11352 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 11415 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
11353 11416
@@ -11628,6 +11691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11628 public PacketMethod method; 11691 public PacketMethod method;
11629 public bool Async; 11692 public bool Async;
11630 } 11693 }
11694
11631 public class AsyncPacketProcess 11695 public class AsyncPacketProcess
11632 { 11696 {
11633 public bool result = false; 11697 public bool result = false;
@@ -11670,4 +11734,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11670 OutPacket(packet, ThrottleOutPacketType.Task); 11734 OutPacket(packet, ThrottleOutPacketType.Task);
11671 } 11735 }
11672 } 11736 }
11673} 11737} \ No newline at end of file