How to disable risky functions in lua in the easiest way?

Possible duplicates:
How to limit the capabilities of lua (calling OS functions, modules, etc.)
How to create a secure Lua sandbox?

luaL_openlibs(m_pState); 

I use this function to load all libs.I would like to skip all dangerous libraries such as IO, but I just can't find the documentation on how to disable lib.

How to disable certain libraries? Are there more dangerous libraries that can access the script system?

+6
source share
1 answer

Add the linit.c project to the project and delete all the libraries that you consider dangerous. To delete individual functions, set them to zero. See Also source demo of Lua .

+4
source

Source: https://habr.com/ru/post/894515/


All Articles