aboutsummaryrefslogtreecommitdiff
path: root/builtin/game/chat.lua
diff options
context:
space:
mode:
authorolive <oliversimmo@gmail.com>2022-04-16 17:50:36 +0100
committerGitHub <noreply@github.com>2022-04-16 18:50:36 +0200
commit062dd8dabc50e01468a59bb9d1d8774e1983cb68 (patch)
treef708953b5189b2bfcb91662667e5d46621a8d66b /builtin/game/chat.lua
parent1d07a365528e3b947a03baba9ef986af2ecd23d1 (diff)
downloadminetest-062dd8dabc50e01468a59bb9d1d8774e1983cb68.tar.gz
minetest-062dd8dabc50e01468a59bb9d1d8774e1983cb68.tar.bz2
minetest-062dd8dabc50e01468a59bb9d1d8774e1983cb68.zip
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.
Diffstat (limited to 'builtin/game/chat.lua')
-rw-r--r--builtin/game/chat.lua4
1 files changed, 4 insertions, 0 deletions
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 <name> <value>' "
.. "to create a new setting.")