1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add unittest that lints builtin JSON files

This commit is contained in:
sfan5 2025-02-26 19:16:41 +01:00
parent 304ce4cd54
commit 47c000a293
2 changed files with 30 additions and 0 deletions

View file

@ -659,6 +659,13 @@ bool ScriptApiSecurity::checkPathWithGamedef(lua_State *L,
}
}
// Allow read-only access to builtin
if (!write_required) {
str = fs::AbsolutePath(Server::getBuiltinLuaPath());
if (!str.empty() && fs::PathStartsWith(abs_path, str))
return true;
}
// Allow read-only access to game directory
if (!write_required) {
const SubgameSpec *game_spec = gamedef->getGameSpec();