如何限制lua的可能性(调用OS功能,模块等) [英] How can I limit lua possibilities (calling OS functions, modules, etc.)
本文介绍了如何限制lua的可能性(调用OS功能,模块等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的C应用程序中使用Lua作为脚本语言.
I am using Lua as a script language inside my C application.
这很适合我,但是我不明白如何限制Lua不要调用系统功能,包括其他模块等.
It suits me well, but I can't understand how can I limit Lua not to call system functions, include other modules, etc.
我希望Lua只能调用我允许的功能,因为用户可以利用Lua + Lua模块的全部功能来做各种不好的事情.
I want Lua to be able to call only functions that are allowed by me, because user can do all kind of bad things with full Lua + Lua modules power.
推荐答案
在Lua-users Wiki上查看简单沙箱: http://lua-users.org/wiki/SandBoxes
Take a look at the Simple Sandbox on the Lua-users wiki: http://lua-users.org/wiki/SandBoxes
相关的SO讨论:
这篇关于如何限制lua的可能性(调用OS功能,模块等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文