Skip to content
Snippets Groups Projects
Commit b5a58ec1 authored by Luigi Scarso's avatar Luigi Scarso
Browse files

--safer or --shell-escape set ffi=nil

parent b787c7c9
No related branches found
No related tags found
No related merge requests found
% luainit.w
%
% Copyright 2006-2016 Taco Hoekwater <taco@@luatex.org>
% Copyright 2006-2017 Taco Hoekwater <taco@@luatex.org>
%
% This file is part of LuaTeX.
%
......@@ -417,7 +417,7 @@ static void parse_options(int ac, char **av)
"the terms of the GNU General Public License, version 2 or (at your option)\n"
"any later version. For more information about these matters, see the file\n"
"named COPYING and the LuaTeX source.\n\n"
"LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team.\n");
"LuaTeX is Copyright 2017 Taco Hoekwater and the LuaTeX Team.\n");
/* *INDENT-ON* */
uexit(0);
} else if (ARGUMENT_IS("credits")) {
......
......@@ -349,6 +349,10 @@ void luainterpreter(void)
(void) hide_lua_value(L, "lfs", "rmdir");
(void) hide_lua_value(L, "lfs", "mkdir");
}
/* Maybe we can extend this way to the others tables, using luac. */
if ( safer_option || ((shellenabledp == 0) || (shellenabledp == 1 && restrictedshell == 1)) ) {
(void) luaL_dostring(L,"ffi=require[[ffi]]; for k,_ in pairs(ffi) do if k~='gc' then ffi[k]=nil end ;end; ffi=nil;");
}
/* fprintf(stdout, "\nLuajitTeX default hash function type:%s\n", */
/* jithash_hashname); */
Luas = L;
......
......@@ -310,6 +310,10 @@ void luainterpreter(void)
(void) hide_lua_value(L, "lfs", "rmdir");
(void) hide_lua_value(L, "lfs", "mkdir");
}
/* Maybe we can extend this way to the others tables, using luac. */
if ( safer_option || ((shellenabledp == 0) || (shellenabledp == 1 && restrictedshell == 1)) ) {
(void) luaL_dostring(L,"ffi=require[[ffi]]; for k,_ in pairs(ffi) do if k~='gc' then ffi[k]=nil end; end; ffi=nil;");
}
Luas = L;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment