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:
parent
304ce4cd54
commit
47c000a293
2 changed files with 30 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue