mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Refactor loading of Lua code with mod security
This commit is contained in:
parent
17191a60fb
commit
5ab546f99b
2 changed files with 28 additions and 52 deletions
|
@ -50,6 +50,8 @@ public:
|
|||
void initializeSecurityClient();
|
||||
// Checks if the Lua state has been secured
|
||||
static bool isSecure(lua_State *L);
|
||||
// Loads a string as Lua code safely (doesn't allow bytecode).
|
||||
static bool safeLoadString(lua_State *L, const std::string &code, const char *chunk_name);
|
||||
// Loads a file as Lua code safely (doesn't allow bytecode).
|
||||
static bool safeLoadFile(lua_State *L, const char *path, const char *display_name = NULL);
|
||||
// Checks if mods are allowed to read (and optionally write) to the path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue