lua-users home
lua-l archive

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


The simplest route to sandboxing probably consists of:

1. Write a routine to do a recursive copy on tables. It probably needs to be
aware of table cycles but only if you care about exporting _G or the
equivalent.

2. Build a table containing just the items you want available.

3. After loading the string to execute, do a setfenv with a deep copy (1) of
the table created in (2).

Lazy versions of (1) based on proxy tables, but that has its own set of
problems.

Mark