[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Sandboxed Lua] Limit execution time, loop iterations and memory usage
- From: Patrick Donnelly <batrick@...>
- Date: Tue, 8 Jun 2010 09:17:40 -0400
On Tue, Jun 8, 2010 at 9:10 AM, <firstname.lastname@example.org> wrote:
> I'm working on a sandboxed version of Lua which can be called from PHP to allow users to run their own scripts. It's quite safe so far, the only problem is that users may create infinite loops, use all system memory or have their scripts run for a very long time.
> Is there any way of solving these problems? A function like set_time_limit() in PHP would be great, or the possibility to overwrite the normal while- and for-loops with a custom implementation that e.g. allows only up to 1000 iterations.
> Another issue is the memory problem, how can I be sure the user doesn't create variables over variables and thus spams the system memory?
There are many threads on this subject. Google more if those don't
answer all your questions :).
- Patrick Donnelly