]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Send chat error when attemping to /set a secure setting (#12193)
authorolive <oliversimmo@gmail.com>
Sat, 16 Apr 2022 16:50:36 +0000 (17:50 +0100)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 16:50:36 +0000 (18:50 +0200)
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

index 493bb92c05a227d7a797e4922c676ef37c8a2ba7..78d6bef981bb6b13064ecadb0af1dfd65d1af47f 100644 (file)
@@ -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.")