summaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_security.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2019-11-08 18:35:32 +0100
committersfan5 <sfan5@live.de>2019-11-09 16:08:38 +0100
commit5ab546f99bf3f438a8d19a3582798b5ab98476d6 (patch)
treef7626b33db832ef21e25bc1f1e9f710b3413b189 /src/script/cpp_api/s_security.h
parent17191a60fb9e499d53cf8a4835ddd9ee2d307898 (diff)
downloadminetest-5ab546f99bf3f438a8d19a3582798b5ab98476d6.tar.gz
minetest-5ab546f99bf3f438a8d19a3582798b5ab98476d6.tar.bz2
minetest-5ab546f99bf3f438a8d19a3582798b5ab98476d6.zip
Refactor loading of Lua code with mod security
Diffstat (limited to 'src/script/cpp_api/s_security.h')
-rw-r--r--src/script/cpp_api/s_security.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_security.h b/src/script/cpp_api/s_security.h
index c31aff26b..73e763548 100644
--- a/src/script/cpp_api/s_security.h
+++ b/src/script/cpp_api/s_security.h
@@ -50,6 +50,8 @@ public:
void initializeSecurityClient();
// Checks if the Lua state has been secured
static bool isSecure(lua_State *L);
+ // Loads a string as Lua code safely (doesn't allow bytecode).
+ 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