I'm currently adding lua (5.1/luajit) to a game (the stock modding system they provide is really crappy).
Now I don't want any modders to mess peoples PC's up, that's why I decided it needs a sandbox (also, hosting providers wouldn't accept it otherwise). So I patched one together from bits and pieces I found while doing research and extended it with my own ideas.
The problem is, sandboxing has many pitfalls, and I'm really new to lua. So I would really appreciate if anyone could take a look at my code and tell me if there is anything wrong with it. Don't want to waste anyones time but I figured this is the place to ask.
My goals were:
- Lock user to a specific directory and allow I/O on everything in it
- Prevent program execution, except lua scripts in user dir
- Prevent access to parent environment
I don't care about crashes.
I decided to link the code instead of pasting it, because the message would be really long otherwise.