let ossl have its own config section

httptests
UbitUmarov 2018-02-02 03:50:43 +00:00
parent 5ae09e03aa
commit c889eb64e5
2 changed files with 96 additions and 91 deletions

View File

@ -144,6 +144,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
internal bool m_debuggerSafe = false;
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
protected IUrlModule m_UrlModule = null;
internal IConfig m_osslconfig;
public void Initialize(
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item)
@ -151,11 +152,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_ScriptEngine = scriptEngine;
m_host = host;
m_item = item;
m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"];
if(m_osslconfig == null)
m_osslconfig = m_ScriptEngine.Config;
m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
if (m_osslconfig.GetBoolean("AllowOSFunctions", false))
{
m_OSFunctionsEnabled = true;
// m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED");
@ -166,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_ScriptDistanceFactor =
m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow");
string risk = m_osslconfig.GetString("OSFunctionThreatLevel", "VeryLow");
switch (risk)
{
case "NoAccess":
@ -292,8 +297,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
FunctionPerms perms = new FunctionPerms();
m_FunctionPerms[function] = perms;
string ownerPerm = m_ScriptEngine.Config.GetString("Allow_" + function, "");
string creatorPerm = m_ScriptEngine.Config.GetString("Creators_" + function, "");
string ownerPerm = m_osslconfig.GetString("Allow_" + function, "");
string creatorPerm = m_osslconfig.GetString("Creators_" + function, "");
if (ownerPerm == "" && creatorPerm == "")
{
// Default behavior

View File

@ -9,7 +9,7 @@
; mis-used so the permission to execute a function can be limited. Ability to
; execute a function is based on the owner of the prim holding the script.
[XEngine]
[OSSL]
; Allow the use of os* functions (some are dangerous)
AllowOSFunctions = true
@ -46,7 +46,7 @@
; "PARCEL_GROUP_MEMBER" -- enable for any member of the parcel group
; uuid -- enable for specified ID (may be avatar or group ID)
; from this we can also create macros that can be include in the list as
; ${XEngine|macroname} see examples below
; ${OSSL|macroname} see examples below
; parcel macros
; Allowing ossl functions for anyone owning a parcel can be dangerous especially if
@ -62,7 +62,7 @@
; NPC macros
; These can be mis-used so limit use to those you can trust.
osslNPC = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
osslNPC = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
; The OSSL function name is prepended with "Allow_" and it checks against
; the owners of the containing prim. There can also be entries beginning with
@ -72,18 +72,18 @@
; *************************************************
; ThreatLevel None
Allow_osGetAgents = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetAvatarList = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetAgents = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetAvatarList = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGender = true
Allow_osGetHealth = true
Allow_osGetHealRate = true
Allow_osGetNPCList = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNPCList = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRezzingObject = true
Allow_osNpcGetOwner = ${XEngine|osslNPC}
Allow_osNpcGetOwner = ${OSSL|osslNPC}
Allow_osParseJSON = true
Allow_osParseJSONNew = true
Allow_osSetSunParam = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportOwner = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetSunParam = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportOwner = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osWindActiveModelPluginName = true
; ThreatLevel Nuisance
@ -91,100 +91,100 @@
Allow_osSetRegionSunSettings = ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel VeryLow
Allow_osEjectFromGroup = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceBreakAllLinks = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceBreakLink = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osEjectFromGroup = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceBreakAllLinks = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceBreakLink = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetWindParam = true
Allow_osInviteToGroup = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osInviteToGroup = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osReplaceString = true
Allow_osSetDynamicTextureData = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataFace = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataBlend = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataBlendFace = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURL = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURLBlend = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURLBlendFace = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetParcelMediaURL = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetParcelSIPAddress = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureData = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataFace = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataBlend = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureDataBlendFace = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURL = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURLBlend = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetDynamicTextureURLBlendFace = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetParcelMediaURL = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetParcelSIPAddress = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetPrimFloatOnWater = true
Allow_osSetWindParam = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetWindParam = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTerrainFlush = ESTATE_MANAGER,ESTATE_OWNER
Allow_osUnixTimeToTimestamp = true
; ThreatLevel Low
Allow_osAvatarName2Key = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osAvatarName2Key = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osFormatString = true
Allow_osKey2Name = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osKey2Name = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osListenRegex = true
Allow_osLoadedCreationDate = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osLoadedCreationID = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osLoadedCreationTime = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMessageObject = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osLoadedCreationDate = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osLoadedCreationID = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osLoadedCreationTime = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMessageObject = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRegexIsMatch = true
Allow_osGetAvatarHomeURI = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osNpcSetProfileAbout = ${XEngine|osslNPC}
Allow_osNpcSetProfileImage = ${XEngine|osslNPC}
Allow_osDie = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetAvatarHomeURI = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osNpcSetProfileAbout = ${OSSL|osslNPC}
Allow_osNpcSetProfileImage = ${OSSL|osslNPC}
Allow_osDie = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel Moderate
Allow_osDropAttachment = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osDropAttachmentAt = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridCustom = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridGatekeeperURI = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridHomeURI = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridLoginURI = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osDropAttachment = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osDropAttachmentAt = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridCustom = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridGatekeeperURI = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridHomeURI = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridLoginURI = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetGridName = true
Allow_osGetGridNick = true
Allow_osGetNumberOfAttachments = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRegionStats = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetSimulatorMemory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetSimulatorMemoryKB = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMessageAttachments = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetSpeed = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNumberOfAttachments = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRegionStats = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetSimulatorMemory = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetSimulatorMemoryKB = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMessageAttachments = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetSpeed = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel High
Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetHealth = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetHealRate = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceAttachToAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceDropAttachment = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceDropAttachmentAt = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetLinkPrimitiveParams = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osCauseDamage = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osCauseHealing = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetHealth = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetHealRate = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceAttachToAvatar = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceAttachToAvatarFromInventory = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceCreateLink = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceDropAttachment = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceDropAttachmentAt = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetLinkPrimitiveParams = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetPhysicsEngineType = true
Allow_osGetPrimitiveParams = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRegionMapTexture = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetPrimitiveParams = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetRegionMapTexture = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetScriptEngineName = true
Allow_osGetSimulatorVersion = true
Allow_osMakeNotecard = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMakeNotecard = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMatchString = true
Allow_osNpcCreate = ${XEngine|osslNPC}
Allow_osNpcGetPos = ${XEngine|osslNPC}
Allow_osNpcGetRot = ${XEngine|osslNPC}
Allow_osNpcLoadAppearance = ${XEngine|osslNPC}
Allow_osNpcMoveTo = ${XEngine|osslNPC}
Allow_osNpcMoveToTarget = ${XEngine|osslNPC}
Allow_osNpcPlayAnimation = ${XEngine|osslNPC}
Allow_osNpcRemove = ${XEngine|osslNPC}
Allow_osNpcSaveAppearance = ${XEngine|osslNPC}
Allow_osNpcSay = ${XEngine|osslNPC}
Allow_osNpcSetRot = ${XEngine|osslNPC}
Allow_osNpcShout = ${XEngine|osslNPC}
Allow_osNpcSit = ${XEngine|osslNPC}
Allow_osNpcStand = ${XEngine|osslNPC}
Allow_osNpcStopAnimation = ${XEngine|osslNPC}
Allow_osNpcStopMoveToTarget = ${XEngine|osslNPC}
Allow_osNpcTouch = ${XEngine|osslNPC}
Allow_osNpcWhisper = ${XEngine|osslNPC}
Allow_osOwnerSaveAppearance = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osNpcCreate = ${OSSL|osslNPC}
Allow_osNpcGetPos = ${OSSL|osslNPC}
Allow_osNpcGetRot = ${OSSL|osslNPC}
Allow_osNpcLoadAppearance = ${OSSL|osslNPC}
Allow_osNpcMoveTo = ${OSSL|osslNPC}
Allow_osNpcMoveToTarget = ${OSSL|osslNPC}
Allow_osNpcPlayAnimation = ${OSSL|osslNPC}
Allow_osNpcRemove = ${OSSL|osslNPC}
Allow_osNpcSaveAppearance = ${OSSL|osslNPC}
Allow_osNpcSay = ${OSSL|osslNPC}
Allow_osNpcSetRot = ${OSSL|osslNPC}
Allow_osNpcShout = ${OSSL|osslNPC}
Allow_osNpcSit = ${OSSL|osslNPC}
Allow_osNpcStand = ${OSSL|osslNPC}
Allow_osNpcStopAnimation = ${OSSL|osslNPC}
Allow_osNpcStopMoveToTarget = ${OSSL|osslNPC}
Allow_osNpcTouch = ${OSSL|osslNPC}
Allow_osNpcWhisper = ${OSSL|osslNPC}
Allow_osOwnerSaveAppearance = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osParcelJoin = ESTATE_MANAGER,ESTATE_OWNER
Allow_osParcelSubdivide = ESTATE_MANAGER,ESTATE_OWNER
Allow_osRegionRestart = ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetContentType = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetContentType = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetPrimitiveParams = false
Allow_osSetProjectionParams = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetProjectionParams = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetRegionWaterHeight = ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetStateEvents = false ; deprecated
Allow_osSetTerrainHeight = ESTATE_MANAGER,ESTATE_OWNER
@ -203,20 +203,20 @@
Allow_osForceDetachFromAvatar = false
Allow_osForceOtherSit = false
; The notecard functions can cause a lot of load on the region if over used
Allow_osGetNotecard = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNotecardLine = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNumberOfNotecardLines = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNotecard = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNotecardLine = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osGetNumberOfNotecardLines = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRegionNotice = ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetRot = false
Allow_osSetParcelDetails = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetParcelDetails = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel Severe
Allow_osConsoleCommand = false
Allow_osGrantScriptPermissions = false
Allow_osKickAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osKickAvatar = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRevokeScriptPermissions = false
Allow_osTeleportAgent = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportObject = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportAgent = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osTeleportObject = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel Severe with additional internal restrictions
Allow_osGetAgentIP = true ; always restricted to Administrators (true or false to disable)