aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs101
1 files changed, 82 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b3f5f09..c4e8e09 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -7091,32 +7091,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7091 taskID = new UUID(transfer.TransferInfo.Params, 48); 7091 taskID = new UUID(transfer.TransferInfo.Params, 48);
7092 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 7092 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7093 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
7094 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7099 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
7095 { 7100 {
7096 if (taskID != UUID.Zero) // Prim 7101 if (taskID != UUID.Zero) // Prim
7097 { 7102 {
7098 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); 7103 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
7104
7099 if (part == null) 7105 if (part == null)
7106 {
7107 m_log.WarnFormat(
7108 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7109 Name, requestID, itemID, taskID);
7100 return true; 7110 return true;
7111 }
7101 7112
7102 if (part.OwnerID != AgentId) 7113 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7103 return true; 7114 if (tii == null)
7104 7115 {
7105 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 7116 m_log.WarnFormat(
7106 return true; 7117 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7107 7118 Name, requestID, itemID, taskID);
7108 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
7109 if (ti == null)
7110 return true;
7111
7112 if (ti.OwnerID != AgentId)
7113 return true;
7114
7115 if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7116 return true;
7117
7118 if (ti.AssetID != requestID)
7119 return true; 7119 return true;
7120 }
7121
7122 if (tii.Type == (int)AssetType.LSLText)
7123 {
7124 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7125 return true;
7126 }
7127 else if (tii.Type == (int)AssetType.Notecard)
7128 {
7129 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7130 return true;
7131 }
7132 else
7133 {
7134 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7135 // shared with group. In fact, all this permissions checking should move to an IPermissionsModule
7136 if (part.OwnerID != AgentId)
7137 {
7138 m_log.WarnFormat(
7139 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7140 Name, requestID, itemID, taskID, part.OwnerID);
7141 return true;
7142 }
7143
7144 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7145 {
7146 m_log.WarnFormat(
7147 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7148 Name, requestID, itemID, taskID);
7149 return true;
7150 }
7151
7152 if (tii.OwnerID != AgentId)
7153 {
7154 m_log.WarnFormat(
7155 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7156 Name, requestID, itemID, taskID, tii.OwnerID);
7157 return true;
7158 }
7159
7160 if ((
7161 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7162 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7163 {
7164 m_log.WarnFormat(
7165 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7166 Name, requestID, itemID, taskID);
7167 return true;
7168 }
7169
7170 if (tii.AssetID != requestID)
7171 {
7172 m_log.WarnFormat(
7173 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
7174 Name, requestID, itemID, taskID, tii.AssetID);
7175 return true;
7176 }
7177 }
7120 } 7178 }
7121 else // Agent 7179 else // Agent
7122 { 7180 {
@@ -7154,7 +7212,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7154 } 7212 }
7155 7213
7156 if (assetRequestItem.AssetID != requestID) 7214 if (assetRequestItem.AssetID != requestID)
7215 {
7216 m_log.WarnFormat(
7217 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7218 Name, requestID, itemID, assetRequestItem.AssetID);
7157 return true; 7219 return true;
7220 }
7158 } 7221 }
7159 } 7222 }
7160 } 7223 }
@@ -11389,7 +11452,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11389 // } 11452 // }
11390 } 11453 }
11391 11454
11392 //m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); 11455// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11393 11456
11394 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 11457 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
11395 } 11458 }
@@ -11757,4 +11820,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11757 OutPacket(dialog, ThrottleOutPacketType.Task); 11820 OutPacket(dialog, ThrottleOutPacketType.Task);
11758 } 11821 }
11759 } 11822 }
11760} 11823} \ No newline at end of file