lua-users home
lua-l archive

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


Hi!

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?

Thanks for your answers!