lua-users home
lua-l archive

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


That doesn't look like its working.

On 4/19/2012 8:28 PM, Vinicius Jarina wrote:
You can wrap your call with a lua code like:

caller.p <-- sandbox setup

lua_pushstring <-- script_to_run.p
luaL_loadfile (caller.p)
lua_pcall() <-- execute caller , then caller will call your script 
;)

Vinicius Jarina

On Thu, Apr 19, 2012 at 8:04 AM, forum <forumme5487@live.com> wrote:
Yes I have read it. The point being just run an env without them.

But that only applies to doing it from lua, not doing it from c/c++. Within the application itself.


On 4/19/2012 7:34 PM, Patrick Rapin wrote:
How can I run a safe sandbox from within a c/c++ application?
This is a very complex question, going far beyond setting "io" to nil.
You must begin to read that document [1], and probably others too.

For your specific question, instead of calling the default
luaL_openlibs, provide your version of it.
It is easier than "unregistering" libraries thereafter.

[1] http://lua-users.org/wiki/SandBoxes