From 062dd8dabc50e01468a59bb9d1d8774e1983cb68 Mon Sep 17 00:00:00 2001 From: olive Date: Sat, 16 Apr 2022 17:50:36 +0100 Subject: Send chat error when attemping to /set a secure setting (#12193) Attempting to /set a secure setting will now say that is disallowed. Previously this would shut down the server. Reading secure settings via /set is still allowed. --- builtin/game/chat.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/game/chat.lua b/builtin/game/chat.lua index 493bb92c0..78d6bef98 100644 --- a/builtin/game/chat.lua +++ b/builtin/game/chat.lua @@ -621,6 +621,10 @@ core.register_chatcommand("set", { setname, setvalue = string.match(param, "([^ ]+) (.+)") if setname and setvalue then + if setname:sub(1, 7) == "secure." then + return false, S("Failed. Cannot modify secure settings. " + .. "Edit the settings file manually.") + end if not core.settings:get(setname) then return false, S("Failed. Use '/set -n ' " .. "to create a new setting.") -- cgit v1.2.3