[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Restricted compile/execute mode
- From: Tomas Guisasola Gorham <tomas@...>
- Date: Sun, 28 Oct 2007 01:27:24 -0200 (BRST)
> > Is there an easy way to restrict the behaviour of the configuration code?
>
> You can write reader function that starts by sending "return {" and ends
> by sending "}" and that appends "," after each input line. In this way,
> only assignments and inner table constructors are valid in the input. Of
> course, you still need to limit exported functions.
But this way you would still accept (weird) things like:
(function () _G.mynewfunction = function () ... end end)()
Which will be translated to:
return {
(function () _G.mynewfunction = function () ... end end)() ,
}
And will create a new function in a global variable.
Regards,
Tomás