Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minetest.settings to CSM API and allow CSMs to provide settingtypes.txt #12131

Merged
merged 8 commits into from
Aug 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
SECURITY
  • Loading branch information
SmallJoker committed Jul 31, 2022
commit cd1322b105d734107b77c3974f7e24b87c9c50f8
6 changes: 6 additions & 0 deletions src/script/cpp_api/s_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@ void ScriptApiSecurity::setLuaEnv(lua_State *L, int thread)

bool ScriptApiSecurity::isSecure(lua_State *L)
{
#ifndef SERVER
auto script = ModApiBase::getScriptApiBase(L);
// CSM keeps no globals backup but is always secure
if (script->getType() == ScriptingType::Client)
return true;
#endif
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_GLOBALS_BACKUP);
bool secure = !lua_isnil(L, -1);
lua_pop(L, 1);
Expand Down