summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/supple/sandbox.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/supple/sandbox.lua b/lib/supple/sandbox.lua
index 3d9d93a..db3532d 100644
--- a/lib/supple/sandbox.lua
+++ b/lib/supple/sandbox.lua
@@ -47,8 +47,6 @@ local function set_limits(ltab)
end
local function _wrap(fn, src, globs)
- globs = globs or {}
- local fn_glob = setmetatable({}, { __index = globs, __metatable=true })
local fn_ret, msg
assert(fn, "No function/source provided?")
@@ -60,10 +58,10 @@ local function _wrap(fn, src, globs)
if not fn_ret then
return nil, msg
end
- setfenv(fn_ret, fn_glob)
+ setfenv(fn_ret, globs)
else
-- Lua 5.2 style load...
- fn_ret, msg = load(fn, src, "t", fn_glob)
+ fn_ret, msg = load(fn, src, "t", globs)
if not fn_ret then
return nil, msg
end
@@ -71,7 +69,7 @@ local function _wrap(fn, src, globs)
assert(fn_ret, "Unusual, missing fn_ret now?")
- return fn_ret, fn_glob
+ return fn_ret, globs
end
local function wrapped_unpack(t)