From 9f932a42057b4a9cd4517c90007a7c31c98277c6 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 5 Jun 2009 09:47:42 +0000
Subject: Thank you, thomax, for a patch to provide finer-grained access
control to scripting. Fixes Mantis #2862
---
OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index fcb3339..911da5b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -37,6 +37,7 @@ using Microsoft.VisualBasic;
using log4net;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.ScriptEngine.Interfaces;
+using OpenMetaverse;
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{
@@ -263,7 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
///
/// LSL script
/// Filename to .dll assembly
- public string PerformScriptCompile(string Script, string asset)
+ public string PerformScriptCompile(string Script, string asset, UUID ownerUUID)
{
m_positionMap = null;
m_warnings.Clear();
@@ -341,6 +342,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
throw new Exception(errtext);
}
+ if(m_scriptEngine.World.Permissions.CanCompileScript(ownerUUID, (int)l) == false) {
+ // Not allowed to compile to this language!
+ string errtext = String.Empty;
+ errtext += ownerUUID + " is not in list of allowed users for this scripting language. Script will not be executed!";
+ throw new Exception(errtext);
+ }
+
string compileScript = Script;
if (l == enumCompileType.lsl)
--
cgit v1.1