[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implementing a simple sandbox
- From: Max Ischenko <max@...>
- Date: Mon, 23 Jun 2003 11:50:09 +0300
[ ... clarification details skipped ... ]
> Hope this helps a bit in your experiments.
Yeah, that helps a lot, thanks!
I've came up with this:
function sandbox(env, f, ...)
local g = getfenv(f)
setfenv(f, env)
local retval = f(unpack(arg))
setfenv(f, g)
return retval
end
Seems to work just fine. Thanks again, Wim!
--
Regards, max.