forked from Mirrorlandia_minetest/minetest
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.
This commit is contained in:
parent
1d07a36552
commit
062dd8dabc
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user