I used "require" to include an external lua script, and that lua script called package.loadlib() to load a dll on Windows 2000 SP4.
This worked just fine... but what does this say about this part of the code in celx.cpp?
Is loadlib supposed to be disallowed?
Code: Select all
// Permit access to the package library, but prohibit use of the loadlib
// function.
void LuaState::allowLuaPackageAccess()
{
#if LUA_VER >= 0x050100
openLuaLibrary(state, LUA_LOADLIBNAME, luaopen_package);
// Disallow loadlib
lua_getfield(state, LUA_GLOBALSINDEX, "package");
lua_pushnil(state);
lua_setfield(state, -2, "loadlib");
lua_pop(state, 1);
#endif
}
BTW, I'm using Lua 5.1 and CVS celestia sources.