Whitelisted some extra LuaJIT and Minetest utility functions

This commit is contained in:
prestidigitator 2015-06-01 15:20:58 -07:00
parent 8f56d4fc79
commit 1e66bbb46e
2 changed files with 15 additions and 9 deletions

View File

@ -46,6 +46,7 @@ local TOP_LEVEL_WHITELIST =
_G = false, -- Replaced by environment itself
_VERSION = true,
assert = true,
bit = true, -- (luajit)
collectgarbage = true,
dofile = false, -- Wrapped below
error = true,
@ -53,6 +54,7 @@ local TOP_LEVEL_WHITELIST =
getfenv = false, -- Wrapped below
getmetatable = false, -- Wrapped below
ipairs = true,
jit = false, -- Removed completely (luajit)
load = false, -- Wrapped below
loadfile = false, -- Wrapped below
loadstring = false, -- Wrapped below
@ -605,6 +607,7 @@ sandboxEnv.package.loaders = { sandboxSearcher, builinSearcher };
sandboxEnv.package.loadlib = nil; -- Removed completely
sandboxEnv.package.path = "";
sandboxEnv.package.preload = {};
sandboxEnv.package.searchpath = nil; -- (luajit)
sandboxEnv.package.seeall = wrappedSeeAll;
sandboxEnv.package.loaded._G = sandboxEnv;

View File

@ -104,4 +104,7 @@ sandboxEnv.minetest.get_modpath = wrappedGetModPath;
sandboxEnv.minetest.create_schematic = wrappedCreateSchematic;
sandboxEnv.minetest.place_schematic = wrappedPlaceSchematic;
sandboxEnv.string.split = std.string.split;
sandboxEnv.string.trim = std.string.trim;
sandboxEnv.table.copy = std.table.copy;
sandboxEnv.Settings = wrappedSettings;