lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>Therefore, sandbox is safe as long as functions
>that I put into it's env. are safe. This is probably not a problem,
>since I know what functions are in that env.

Sure, that's by definition of sandbox, right? You *give* your *chosen*
execution environment. In your example, if you don't trust cheat, don't
add it to the environment.

>Still, it'd be nice to be able to restrict env. of the functions like
>cheat.

In your example, I guess the best that could be done would be
to setfenv(g,B) for all Lua functions g in B. This can be done
automatically in a for loop in sandbox. Is this what you meant?
--lhf