Update library notes

This commit is contained in:
Mm2PL 2023-02-11 16:44:21 +01:00
parent e899599034
commit 5b9f3e95ee
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9

View file

@ -114,11 +114,7 @@ void PluginController::openLibrariesFor(lua_State *L,
// Stuff to change, remove or hide behind a permission system: // Stuff to change, remove or hide behind a permission system:
static const std::vector<luaL_Reg> loadedlibs = { static const std::vector<luaL_Reg> loadedlibs = {
luaL_Reg{LUA_GNAME, luaopen_base}, luaL_Reg{LUA_GNAME, luaopen_base},
// - print - writes to stdout, should be replaced with a per-plugin log // - load - don't allow in release mode
// - load, loadstring, loadfile, dofile - don't allow bytecode, *require* valid utf8 (which bytecode by design isn't)
// luaL_Reg{LUA_LOADLIBNAME, luaopen_package},
// - explicit fs access, probably best to make our own require() function
//luaL_Reg{LUA_COLIBNAME, luaopen_coroutine}, //luaL_Reg{LUA_COLIBNAME, luaopen_coroutine},
// - needs special support // - needs special support
@ -132,9 +128,10 @@ void PluginController::openLibrariesFor(lua_State *L,
luaL_Reg{LUA_STRLIBNAME, luaopen_string}, luaL_Reg{LUA_STRLIBNAME, luaopen_string},
luaL_Reg{LUA_MATHLIBNAME, luaopen_math}, luaL_Reg{LUA_MATHLIBNAME, luaopen_math},
luaL_Reg{LUA_UTF8LIBNAME, luaopen_utf8}, luaL_Reg{LUA_UTF8LIBNAME, luaopen_utf8},
// luaL_Reg{LUA_DBLIBNAME, luaopen_debug},
// - this allows the plugin developer to unleash all hell
}; };
// Warning: Do not add debug library to this, it would make the security of
// this a living nightmare due to stuff like registry access
// - Mm2PL
for (const auto &reg : loadedlibs) for (const auto &reg : loadedlibs)
{ {