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

Add mod security

Due to compatibility concerns, this is temporarily disabled.
This commit is contained in:
ShadowNinja 2014-09-05 20:08:51 -04:00
parent f26421228b
commit 3a8c788880
22 changed files with 812 additions and 83 deletions

View file

@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_vmanip.h"
#include "common/c_converter.h"
#include "common/c_content.h"
#include "cpp_api/s_security.h"
#include "util/serialize.h"
#include "server.h"
#include "environment.h"
@ -1031,6 +1032,10 @@ int ModApiMapgen::l_generate_decorations(lua_State *L)
int ModApiMapgen::l_create_schematic(lua_State *L)
{
INodeDefManager *ndef = getServer(L)->getNodeDefManager();
const char *filename = luaL_checkstring(L, 4);
CHECK_SECURE_PATH_OPTIONAL(L, filename);
Map *map = &(getEnv(L)->getMap());
Schematic schem;
@ -1069,8 +1074,6 @@ int ModApiMapgen::l_create_schematic(lua_State *L)
}
}
const char *filename = luaL_checkstring(L, 4);
if (!schem.getSchematicFromMap(map, p1, p2)) {
errorstream << "create_schematic: failed to get schematic "
"from map" << std::endl;