From 5ab546f99bf3f438a8d19a3582798b5ab98476d6 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 8 Nov 2019 18:35:32 +0100 Subject: Refactor loading of Lua code with mod security --- src/script/cpp_api/s_security.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/script/cpp_api/s_security.h') 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 -- cgit v1.2.3