[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Isn't load() in 5.2 too naive about _ENV?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 6 Oct 2011 10:59:22 -0300
> _ENV is to function what default gateway is to network station. In
> abstract thinking, there is no _ENV, right. But in field of sandbox
> programming, _ENV is *the* conception.
I beg to differ. _ENV is irrelevant for sandbox programming, as it is
only a compiler trick. Whatever you can do with _ENV you can do without
What is very relevant to sandboxing is the behavior of 'load', as it
offers the global environment to the function being loaded. (From a
security point of view, it is irrelevant whether this global environment
is being set to _ENV or any other upvalue.) So, as you said, sandboxes
should not use 'load' without an explicit env argument (or without a
What is also very relevant to sandboxing is whether we can change the
behavior of a function without using the debug library.