mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue