1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Deprecate writing to mod directories (#14486)

This commit is contained in:
rubenwardy
2024-03-27 18:32:05 +00:00
committed by GitHub
parent 6a7a613741
commit b487341c32
2 changed files with 51 additions and 20 deletions

View File

@@ -49,12 +49,12 @@ public:
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
static bool checkPath(lua_State *L, const char *path, bool write_required,
bool *write_allowed=NULL);
// Check if mod is whitelisted in the given setting
// This additionally checks that the mod's main file scope is executing.
static bool checkWhitelisted(lua_State *L, const std::string &setting);
// Checks if mods are allowed to read (and optionally write) to the path
static bool checkPath(lua_State *L, const char *path, bool write_required,
bool *write_allowed=NULL);
private:
int getThread(lua_State *L);