[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: Multiple lua instances
- From: Bulat Ziganshin <bulat.ziganshin@...>
- Date: Tue, 19 Jan 2010 20:32:01 +0300
Hello ingmar,
Tuesday, January 19, 2010, 8:07:23 PM, you wrote:
>> function sandboxed_function()
>> print "hello, world!"
>> end
> But when i permit the user to modifie the ai, he could simply remove the line
> setfenv(sandboxed_function, { print = print })
here body of sandboxed_function should be considered as example of
script written by user.
it can define functions and call functions provided in fenv, but
nothing more. it's the whole idea - you give user access only to some
set of functions. if you don't include here functions that load
external C libraries or directly modify memory, then it's impossible
to run out of your sandbox. everything that user can do is to call
provided functions with some arguments
--
Best regards,
Bulat mailto:Bulat.Ziganshin@gmail.com