1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);