[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Implementing a simple sandbox -- another quirk
- From: Max Ischenko <max@...>
- Date: Wed, 25 Jun 2003 09:43:55 +0300
Luiz Henrique de Figueiredo wrote:
> >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
> 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?
Yes! That's what I was missing.
Thanks for the tip and fruitful discussion.