mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Mod security: Allow read-only access to all mod paths
This commit is contained in:
@@ -263,7 +263,7 @@ int LuaAreaStore::l_to_file(lua_State *L)
|
||||
AreaStore *ast = o->as;
|
||||
|
||||
const char *filename = luaL_checkstring(L, 2);
|
||||
CHECK_SECURE_PATH_OPTIONAL(L, filename);
|
||||
CHECK_SECURE_PATH(L, filename, true);
|
||||
|
||||
std::ostringstream os(std::ios_base::binary);
|
||||
ast->serialize(os);
|
||||
@@ -294,7 +294,7 @@ int LuaAreaStore::l_from_file(lua_State *L)
|
||||
LuaAreaStore *o = checkobject(L, 1);
|
||||
|
||||
const char *filename = luaL_checkstring(L, 2);
|
||||
CHECK_SECURE_PATH_OPTIONAL(L, filename);
|
||||
CHECK_SECURE_PATH(L, filename, false);
|
||||
|
||||
std::ifstream is(filename, std::ios::binary);
|
||||
return deserialization_helper(L, o->as, is);
|
||||
|
Reference in New Issue
Block a user