From 8a65f5a70dea70073790c15ba2ae7739771f74b5 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 19:18:28 +0300 Subject: [PATCH] OSSL: Removed check for CanRunConsoleCommand() in osKickAvatar. OSSL permissions are now controlled in OpenSim.ini. --- .../Shared/Api/Implementation/OSSL_Api.cs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 893fda1ad98..0d4ea198e90 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -351,7 +351,7 @@ public void CheckThreatLevel(ThreatLevel level, string function) UUID ownerID = ti.OwnerID; - //OSSL only may be used if objet is in the same group as the parcel + //OSSL only may be used if object is in the same group as the parcel if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) { ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); @@ -729,11 +729,13 @@ public bool osConsoleCommand(string command) m_host.AddScriptLPS(1); + // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) { MainConsole.Instance.RunCommand(command); return true; } + return false; } @@ -2825,21 +2827,18 @@ public void osKickAvatar(string FirstName,string SurName,string alert) CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); m_host.AddScriptLPS(1); - if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + World.ForEachRootScenePresence(delegate(ScenePresence sp) { - World.ForEachRootScenePresence(delegate(ScenePresence sp) + if (sp.Firstname == FirstName && sp.Lastname == SurName) { - if (sp.Firstname == FirstName && sp.Lastname == SurName) - { - // kick client... - if (alert != null) - sp.ControllingClient.Kick(alert); + // kick client... + if (alert != null) + sp.ControllingClient.Kick(alert); - // ...and close on our side - sp.Scene.IncomingCloseAgent(sp.UUID); - } - }); - } + // ...and close on our side + sp.Scene.IncomingCloseAgent(sp.UUID); + } + }); } public void osCauseDamage(string avatar, double damage)