Backport another bugfix (hopefully)

This commit is contained in:
luk3yx 2020-08-29 22:09:55 +12:00
parent 98d3e309ce
commit 2f6bc4ff22
2 changed files with 13 additions and 1 deletions

View File

@ -80,6 +80,8 @@ if it determines they are necessary for your server:
- Blocking newlines in chat messages (MT < 5.0.1). - Blocking newlines in chat messages (MT < 5.0.1).
- Prevent saying `%2` in chat from crashing the server (MT == 5.1.0). - Prevent saying `%2` in chat from crashing the server (MT == 5.1.0).
- Prevent hacked clients from being able to access the inventories of other
players (MT < 5.4.0).
If you do not want this for whatever reason (although I do not recommend it), If you do not want this for whatever reason (although I do not recommend it),
you can disable these backports by adding `cloaking.backport_bugfixes = false` you can disable these backports by adding `cloaking.backport_bugfixes = false`

View File

@ -1,7 +1,7 @@
-- --
-- Minetest player cloaking mod -- Minetest player cloaking mod
-- --
-- © 2019 by luk3yx -- © 2020 by luk3yx
-- --
local path = minetest.get_modpath('cloaking') local path = minetest.get_modpath('cloaking')
dofile(path .. '/core.lua') dofile(path .. '/core.lua')
@ -71,3 +71,13 @@ if minetest.format_chat_message then
end end
end end
end end
-- Backport https://github.com/minetest/minetest/pull/10341
-- TODO: Only apply this workaround on vulnerable MT versions.
minetest.register_allow_player_inventory_action(function(player, action, inv)
local inv_location = inv:get_location()
if inv_location.type == 'player' and
inv_location.name ~= player:get_player_name() then
return 0
end
end)