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.cs105
1 files changed, 84 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index d41deb0..3262419 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -7078,32 +7078,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7078 taskID = new UUID(transfer.TransferInfo.Params, 48); 7078 taskID = new UUID(transfer.TransferInfo.Params, 48);
7079 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 7079 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7080 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 7080 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7081
7082// m_log.DebugFormat(
7083// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7084// requestID, itemID, taskID, Name);
7085
7081 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7086 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
7082 { 7087 {
7083 if (taskID != UUID.Zero) // Prim 7088 if (taskID != UUID.Zero) // Prim
7084 { 7089 {
7085 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); 7090 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
7091
7086 if (part == null) 7092 if (part == null)
7093 {
7094 m_log.WarnFormat(
7095 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7096 Name, requestID, itemID, taskID);
7087 return true; 7097 return true;
7098 }
7088 7099
7089 if (part.OwnerID != AgentId) 7100 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7090 return true; 7101 if (tii == null)
7091 7102 {
7092 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 7103 m_log.WarnFormat(
7093 return true; 7104 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7094 7105 Name, requestID, itemID, taskID);
7095 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
7096 if (ti == null)
7097 return true;
7098
7099 if (ti.OwnerID != AgentId)
7100 return true;
7101
7102 if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7103 return true;
7104
7105 if (ti.AssetID != requestID)
7106 return true; 7106 return true;
7107 }
7108
7109 if (tii.Type == (int)AssetType.LSLText)
7110 {
7111 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7112 return true;
7113 }
7114 else if (tii.Type == (int)AssetType.Notecard)
7115 {
7116 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7117 return true;
7118 }
7119 else
7120 {
7121 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7122 // shared with group. In fact, this whole block of permissions checking should move to an IPermissionsModule
7123 if (part.OwnerID != AgentId)
7124 {
7125 m_log.WarnFormat(
7126 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7127 Name, requestID, itemID, taskID, part.OwnerID);
7128 return true;
7129 }
7130
7131 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7132 {
7133 m_log.WarnFormat(
7134 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7135 Name, requestID, itemID, taskID);
7136 return true;
7137 }
7138
7139 if (tii.OwnerID != AgentId)
7140 {
7141 m_log.WarnFormat(
7142 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7143 Name, requestID, itemID, taskID, tii.OwnerID);
7144 return true;
7145 }
7146
7147 if ((
7148 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7149 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7150 {
7151 m_log.WarnFormat(
7152 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7153 Name, requestID, itemID, taskID);
7154 return true;
7155 }
7156
7157 if (tii.AssetID != requestID)
7158 {
7159 m_log.WarnFormat(
7160 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
7161 Name, requestID, itemID, taskID, tii.AssetID);
7162 return true;
7163 }
7164 }
7107 } 7165 }
7108 else // Agent 7166 else // Agent
7109 { 7167 {
@@ -7123,7 +7181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7123 // only to notecards and scripts. All 7181 // only to notecards and scripts. All
7124 // other asset types are always available 7182 // other asset types are always available
7125 // 7183 //
7126 if (assetRequestItem.AssetType == 10) 7184 if (assetRequestItem.AssetType == (int)AssetType.LSLText)
7127 { 7185 {
7128 if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) 7186 if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
7129 { 7187 {
@@ -7131,7 +7189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7131 return true; 7189 return true;
7132 } 7190 }
7133 } 7191 }
7134 else if (assetRequestItem.AssetType == 7) 7192 else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
7135 { 7193 {
7136 if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) 7194 if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
7137 { 7195 {
@@ -7141,7 +7199,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7141 } 7199 }
7142 7200
7143 if (assetRequestItem.AssetID != requestID) 7201 if (assetRequestItem.AssetID != requestID)
7202 {
7203 m_log.WarnFormat(
7204 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7205 Name, requestID, itemID, assetRequestItem.AssetID);
7144 return true; 7206 return true;
7207 }
7145 } 7208 }
7146 } 7209 }
7147 } 7210 }
@@ -11376,7 +11439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11376 // } 11439 // }
11377 } 11440 }
11378 11441
11379 //m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); 11442// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11380 11443
11381 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 11444 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
11382 } 11445 }
@@ -11744,4 +11807,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11744 OutPacket(dialog, ThrottleOutPacketType.Task); 11807 OutPacket(dialog, ThrottleOutPacketType.Task);
11745 } 11808 }
11746 } 11809 }
11747} 11810} \ No newline at end of file