aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authormingchen2008-07-09 19:53:22 +0000
committermingchen2008-07-09 19:53:22 +0000
commit817a0fa40c5b026b7c4dcade4a1103ea94cdbc5d (patch)
tree9a10c93f80feb108c1ca8a4882d619573d8c89d0 /OpenSim/Region/Environment
parentMantis#1127. Thank you kindly, Grumly57 for a patch that: (diff)
downloadopensim-SC-817a0fa40c5b026b7c4dcade4a1103ea94cdbc5d.zip
opensim-SC-817a0fa40c5b026b7c4dcade4a1103ea94cdbc5d.tar.gz
opensim-SC-817a0fa40c5b026b7c4dcade4a1103ea94cdbc5d.tar.bz2
opensim-SC-817a0fa40c5b026b7c4dcade4a1103ea94cdbc5d.tar.xz
*Patch as supplied in Mantis #0001705 by melanie. Fixes: Locked prims allow *any avatar* to deposit scripts in them, regardless of permissions
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs45
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs3
2 files changed, 30 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index b0e4a87..704ca5d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1166,6 +1166,12 @@ namespace OpenSim.Region.Environment.Scenes
1166 1166
1167 if (part != null) 1167 if (part != null)
1168 { 1168 {
1169 if (part.OwnerID != remoteClient.AgentId)
1170 return;
1171
1172 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1173 return;
1174
1169 TaskInventoryItem currentItem = part.GetInventoryItem(itemID); 1175 TaskInventoryItem currentItem = part.GetInventoryItem(itemID);
1170 1176
1171 if (currentItem == null) 1177 if (currentItem == null)
@@ -1256,17 +1262,20 @@ namespace OpenSim.Region.Environment.Scenes
1256 SceneObjectPart part = GetSceneObjectPart(localID); 1262 SceneObjectPart part = GetSceneObjectPart(localID);
1257 if (part != null) 1263 if (part != null)
1258 { 1264 {
1259 if (ExternalChecks.ExternalChecksCanRunScript(item.ID, part.UUID, remoteClient.AgentId)) 1265 if (part.OwnerID != remoteClient.AgentId)
1260 { 1266 return;
1261 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
1262 // TODO: set this to "true" when scripts in inventory have persistent state to fire on_rez
1263 part.CreateScriptInstance(copyID, 0, false);
1264 part.GetProperties(remoteClient);
1265 1267
1266 // m_log.InfoFormat("[PRIMINVENTORY]: " + 1268 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1267 // "Rezzed script {0} into prim local ID {1} for user {2}", 1269 return;
1268 // item.inventoryName, localID, remoteClient.Name); 1270
1269 } 1271 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
1272 // TODO: set this to "true" when scripts in inventory have persistent state to fire on_rez
1273 part.CreateScriptInstance(copyID, 0, false);
1274
1275 // m_log.InfoFormat("[PRIMINVENTORY]: " +
1276 // "Rezzed script {0} into prim local ID {1} for user {2}",
1277 // item.inventoryName, localID, remoteClient.Name);
1278 part.GetProperties(remoteClient);
1270 } 1279 }
1271 else 1280 else
1272 { 1281 {
@@ -1291,6 +1300,12 @@ namespace OpenSim.Region.Environment.Scenes
1291 if (part == null) 1300 if (part == null)
1292 return; 1301 return;
1293 1302
1303 if (part.OwnerID != remoteClient.AgentId)
1304 return;
1305
1306 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1307 return;
1308
1294 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}")); 1309 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
1295 AssetCache.AddAsset(asset); 1310 AssetCache.AddAsset(asset);
1296 1311
@@ -1319,10 +1334,7 @@ namespace OpenSim.Region.Environment.Scenes
1319 part.AddInventoryItem(taskItem); 1334 part.AddInventoryItem(taskItem);
1320 part.GetProperties(remoteClient); 1335 part.GetProperties(remoteClient);
1321 1336
1322 if (ExternalChecks.ExternalChecksCanRunScript(taskItem.AssetID, part.UUID, remoteClient.AgentId)) 1337 part.CreateScriptInstance(taskItem, 0, false);
1323 {
1324 part.CreateScriptInstance(taskItem, 0, false);
1325 }
1326 } 1338 }
1327 } 1339 }
1328 1340
@@ -1418,10 +1430,7 @@ namespace OpenSim.Region.Environment.Scenes
1418 1430
1419 if (running > 0) 1431 if (running > 0)
1420 { 1432 {
1421 if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID)) 1433 destPart.CreateScriptInstance(destTaskItem, 0, false);
1422 {
1423 destPart.CreateScriptInstance(destTaskItem, 0, false);
1424 }
1425 } 1434 }
1426 1435
1427 ScenePresence avatar; 1436 ScenePresence avatar;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 3975b25..0b48464 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -162,6 +162,9 @@ namespace OpenSim.Region.Environment.Scenes
162 // "[PRIM INVENTORY]: " + 162 // "[PRIM INVENTORY]: " +
163 // "Starting script {0}, {1} in prim {2}, {3}", 163 // "Starting script {0}, {1} in prim {2}, {3}",
164 // item.Name, item.ItemID, Name, UUID); 164 // item.Name, item.ItemID, Name, UUID);
165 if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID))
166 return;
167
165 AddFlag(LLObject.ObjectFlags.Scripted); 168 AddFlag(LLObject.ObjectFlags.Scripted);
166 169
167 if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) 170 if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))