aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs101
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
5 files changed, 102 insertions, 36 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
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 012d581..d30e954 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -181,7 +181,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
181 Manager.MyScene.AssetService.Store(asset); 181 Manager.MyScene.AssetService.Store(asset);
182 182
183 if (part.Inventory.UpdateInventoryItem(item)) 183 if (part.Inventory.UpdateInventoryItem(item))
184 {
185 remoteClient.SendAgentAlertMessage("Notecard saved", false);
184 part.GetProperties(remoteClient); 186 part.GetProperties(remoteClient);
187 }
185 } 188 }
186 } 189 }
187 } 190 }
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index d940564..01359f0 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1079,7 +1079,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1079 1079
1080 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1080 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1081 return false; 1081 return false;
1082 } else { 1082 }
1083 else
1084 {
1083 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1085 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1084 return false; 1086 return false;
1085 } 1087 }
@@ -1095,7 +1097,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1095 return false; 1097 return false;
1096 1098
1097 if (!IsGroupMember(ti.GroupID, user, 0)) 1099 if (!IsGroupMember(ti.GroupID, user, 0))
1098 return false; 1100 return false;
1099 } 1101 }
1100 1102
1101 // Require full perms 1103 // Require full perms
@@ -1593,14 +1595,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1593 if (part.OwnerID != user) 1595 if (part.OwnerID != user)
1594 { 1596 {
1595 if (part.GroupID == UUID.Zero) 1597 if (part.GroupID == UUID.Zero)
1596 return false; 1598 return false;
1597 1599
1598 if (!IsGroupMember(part.GroupID, user, 0)) 1600 if (!IsGroupMember(part.GroupID, user, 0))
1599 return false; 1601 return false;
1600 1602
1601 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1603 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1602 return false; 1604 return false;
1603 } else { 1605 }
1606 else
1607 {
1604 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1608 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1605 return false; 1609 return false;
1606 } 1610 }
@@ -1855,7 +1859,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1855 return GenericObjectPermission(agentID, prim, false); 1859 return GenericObjectPermission(agentID, prim, false);
1856 } 1860 }
1857 1861
1858 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { 1862 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene)
1863 {
1859 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); 1864 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType);
1860 switch (scriptType) { 1865 switch (scriptType) {
1861 case 0: 1866 case 0:
@@ -1889,4 +1894,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1889 return(false); 1894 return(false);
1890 } 1895 }
1891 } 1896 }
1892} 1897} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ac9644e..15b5230 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -202,7 +202,9 @@ namespace OpenSim.Region.Framework.Scenes
202 202
203 // Update item with new asset 203 // Update item with new asset
204 item.AssetID = asset.FullID; 204 item.AssetID = asset.FullID;
205 group.UpdateInventoryItem(item); 205 if (group.UpdateInventoryItem(item))
206 remoteClient.SendAgentAlertMessage("Notecard saved", false);
207
206 part.GetProperties(remoteClient); 208 part.GetProperties(remoteClient);
207 209
208 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 210 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
@@ -1226,7 +1228,10 @@ namespace OpenSim.Region.Framework.Scenes
1226 remoteClient, part, transactionID, currentItem); 1228 remoteClient, part, transactionID, currentItem);
1227 } 1229 }
1228 if (part.Inventory.UpdateInventoryItem(itemInfo)) 1230 if (part.Inventory.UpdateInventoryItem(itemInfo))
1231 {
1232 remoteClient.SendAgentAlertMessage("Notecard saved", false);
1229 part.GetProperties(remoteClient); 1233 part.GetProperties(remoteClient);
1234 }
1230 } 1235 }
1231 } 1236 }
1232 else 1237 else
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 68f0122..3b1b567 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -626,16 +626,6 @@ namespace OpenSim.Region.Framework.Scenes
626 { 626 {
627 item.AssetID = m_items[item.ItemID].AssetID; 627 item.AssetID = m_items[item.ItemID].AssetID;
628 } 628 }
629 else if ((InventoryType)item.Type == InventoryType.Notecard)
630 {
631 ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID);
632
633 if (presence != null)
634 {
635 presence.ControllingClient.SendAgentAlertMessage(
636 "Notecard saved", false);
637 }
638 }
639 629
640 m_items[item.ItemID] = item; 630 m_items[item.ItemID] = item;
641 m_inventorySerial++; 631 m_inventorySerial++;