From 2798adcdcda0ff88b5a40ff8ca2e40738c943bd9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 21:27:57 +0000 Subject: [PATCH 1/7] use new IsGod on CheckAndAdjustLandingPoint_SL so it can be by current viewer god, acording to config --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bd0786b858..9545c13d85 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -6120,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes string reason; // dont mess with gods - if(IsViewerUIGod || m_scene.Permissions.IsGod(m_uuid)) + if(IsGod) return true; // respect region owner and managers From e2167716aab0d11e09317fcda2001dcabb3a04a5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 21:44:01 +0000 Subject: [PATCH 2/7] change OSSL enable option GOD to use IsGod, so it means a active god, as my original idea --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 +++++++++++-------- bin/config-include/osslEnable.ini | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 066f6a4e1e..07549f808e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -415,14 +415,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - //Only gods may use the function - if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) - { - if (World.Permissions.IsGod(ownerID)) - { - return String.Empty; - } - } //Only grid gods may use the function if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD")) @@ -433,6 +425,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + //Only active gods may use the function + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + { + ScenePresence sp = World.GetScenePresence(ownerID); + if (sp != null && !sp.IsDeleted && sp.IsGod) + { + return String.Empty; + } + } + + if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID)) return( String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index b96688bafd..3859ba6f60 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -38,7 +38,7 @@ ; against the owner of the object containing the script. ; The comma separated entries in the list may be one of: ; "GRID_GOD" -- enable for users with UserLevel >= 200 - ; "GOD" -- enable for users with any type of god rights + ; "GOD" -- enable for present and with active god power ; "ESTATE_MANAGER" -- enable for estate manager ; "ESTATE_OWNER" -- enable for estate owner ; "PARCEL_OWNER" -- enable for parcel owner From 2d0860ac513f27885620279b83a6be2f703cc8c7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 22:51:56 +0000 Subject: [PATCH 3/7] rename OSSL enable option GOD as ACTIVE_GOD so its use is more clear --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++-- bin/config-include/osslEnable.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 07549f808e..f40bf20f8b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (string id in ids) { string current = id.Trim(); - if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "GOD" || current.ToUpper() == "GRID_GOD") + if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD") { if (!perms.AllowedOwnerClasses.Contains(current)) perms.AllowedOwnerClasses.Add(current.ToUpper()); @@ -426,7 +426,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } //Only active gods may use the function - if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ACTIVE_GOD")) { ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index 3859ba6f60..7bdb7b5cca 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -38,7 +38,7 @@ ; against the owner of the object containing the script. ; The comma separated entries in the list may be one of: ; "GRID_GOD" -- enable for users with UserLevel >= 200 - ; "GOD" -- enable for present and with active god power + ; "ACTIVE_GOD" -- enable for present and with active god power user ; "ESTATE_MANAGER" -- enable for estate manager ; "ESTATE_OWNER" -- enable for estate owner ; "PARCEL_OWNER" -- enable for parcel owner From e5244fe70830d6c9ece23d26039d5cbabe9ce9ff Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 22:53:46 +0000 Subject: [PATCH 4/7] Allow OSSL scripts to softfail --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 07549f808e..06717c6617 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -431,7 +431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) { - return String.Empty; + return "Softfail"; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 9d72b1c697..f4ea5e999e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,6 +927,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { + if (e.InnerException.Message == "Softfail") + return; + string text = e.InnerException.Message + "(script: " + ScriptName + " event: " + data.EventName + From f457925f80ec1651975fc5208cbc06be3ae8891e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 23:12:51 +0000 Subject: [PATCH 5/7] Fix a compile issue and reintroduce the "GOD" script option --- .../Shared/Api/Implementation/OSSL_Api.cs | 11 ++++- .../Shared/Instance/ScriptInstance.cs | 42 +++++++++---------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bb475a26c3..5b783f773d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (string id in ids) { string current = id.Trim(); - if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD") + if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD" || current.ToUpper() == "GOD") { if (!perms.AllowedOwnerClasses.Contains(current)) perms.AllowedOwnerClasses.Add(current.ToUpper()); @@ -425,6 +425,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + //Any god may use the function + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + { + if (World.Permissions.IsAdministrator(ownerID)) + { + return String.Empty; + } + } + //Only active gods may use the function if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ACTIVE_GOD")) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f4ea5e999e..de0a80df5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,28 +927,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { - if (e.InnerException.Message == "Softfail") - return; - - string text = e.InnerException.Message + - "(script: " + ScriptName + - " event: " + data.EventName + - " at " + Part.AbsolutePosition + ")"; - if (text.Length > 1000) - text = text.Substring(0, 1000); - Engine.World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - Part.AbsolutePosition, - Part.Name, Part.UUID, false); - m_log.Debug(string.Format( - "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", - e.InnerException.Message, - data.EventName, - PrimName, - Part.UUID, - Part.AbsolutePosition, - Part.ParentGroup.Scene.Name)); + if (e.InnerException.Message != "Softfail") + { + string text = e.InnerException.Message + + "(script: " + ScriptName + + " event: " + data.EventName + + " at " + Part.AbsolutePosition + ")"; + if (text.Length > 1000) + text = text.Substring(0, 1000); + Engine.World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + Part.AbsolutePosition, + Part.Name, Part.UUID, false); + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", + e.InnerException.Message, + data.EventName, + PrimName, + Part.UUID, + Part.AbsolutePosition, + Part.ParentGroup.Scene.Name)); + } } else { From 556d95ef0581c01e9018e80cc06f755f288d2bca Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 23:36:07 +0000 Subject: [PATCH 6/7] Revert "Allow OSSL scripts to softfail" This reverts commit e5244fe70830d6c9ece23d26039d5cbabe9ce9ff. Conflicts: OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs --- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- .../Shared/Instance/ScriptInstance.cs | 39 +++++++++---------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5b783f773d..e769c6da10 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -440,7 +440,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) { - return "Softfail"; + return String.Empty; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index de0a80df5c..9d72b1c697 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,28 +927,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { - if (e.InnerException.Message != "Softfail") - { - string text = e.InnerException.Message + - "(script: " + ScriptName + - " event: " + data.EventName + - " at " + Part.AbsolutePosition + ")"; - if (text.Length > 1000) - text = text.Substring(0, 1000); - Engine.World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - Part.AbsolutePosition, - Part.Name, Part.UUID, false); - m_log.Debug(string.Format( - "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", - e.InnerException.Message, - data.EventName, - PrimName, - Part.UUID, - Part.AbsolutePosition, - Part.ParentGroup.Scene.Name)); + string text = e.InnerException.Message + + "(script: " + ScriptName + + " event: " + data.EventName + + " at " + Part.AbsolutePosition + ")"; + if (text.Length > 1000) + text = text.Substring(0, 1000); + Engine.World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + Part.AbsolutePosition, + Part.Name, Part.UUID, false); + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", + e.InnerException.Message, + data.EventName, + PrimName, + Part.UUID, + Part.AbsolutePosition, + Part.ParentGroup.Scene.Name)); - } } else { From 8662606f7b2c140fa47fb8eae7f2594be517f966 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 23:38:55 +0000 Subject: [PATCH 7/7] add the new GOD ossl option to osslEnable.ini --- bin/config-include/osslEnable.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index 7bdb7b5cca..45eddf748e 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -38,7 +38,8 @@ ; against the owner of the object containing the script. ; The comma separated entries in the list may be one of: ; "GRID_GOD" -- enable for users with UserLevel >= 200 - ; "ACTIVE_GOD" -- enable for present and with active god power user + ; "GOD" -- enable for users with rights to be god (local or grid) + ; "ACTIVE_GOD" -- enable for users that are present and with active god power ; "ESTATE_MANAGER" -- enable for estate manager ; "ESTATE_OWNER" -- enable for estate owner ; "PARCEL_OWNER" -- enable for parcel owner