I want to block the io library so that community created scripts don't have access to it.
I could simply create a Lua state without it, but here's the dilemma: community scripts should still be able to use the io library by calling loadfile() on libraries created by the dev team that have wrapped io functions in them.
I found no way to achieve this duality of blocking functions/libraries from community scripts while still allowing said scripts to run the offending functions/libraries if they are wrapped (for sanitization purposes) in another dev-maintainted library which community scripts can load with loadfile(). I'm resorting to the ugly method of blacklisting certain strings so if the script has them, it doesn't run. BTW, the blacklist is checked from the C++ side where the script to run is a string variable that is fed to the VM if it's clean.
If I blacklist...
"_G", "io.", "io .", "io}", "io }", "io ", "=io", "= io", "{io", "{ io", ",io", ", io", " io"
...is it still possible to call io library functions, or do I have everything covered? The reason blocking _G is a must is this:
a = "i"
b = "o"
boom = _G[a..b]
I want to know if another 'hack' is possible. Also, I welcome alternatives on how I can achieve the aforementioned duality without blacklisting strings.