mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
Merge branch 'dev' of github.com:thibaudlabat/LuaJIT into dev
This commit is contained in:
commit
10cdd1b85f
22
src/luajit.c
22
src/luajit.c
@ -580,7 +580,7 @@ int init_seccomp()
|
||||
ALLOW(SYS_close),
|
||||
ALLOW(SYS_getrandom),
|
||||
ALLOW(SYS_brk),
|
||||
//ALLOW(SYS_openat),
|
||||
ALLOW(SYS_openat),
|
||||
ALLOW(SYS_newfstatat),
|
||||
ALLOW(SYS_ioctl),
|
||||
ALLOW(SYS_futex),
|
||||
@ -626,11 +626,8 @@ int do_something()
|
||||
|
||||
return x+y;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define C_FUNCTIONS_N 10
|
||||
|
||||
struct global_var_t {
|
||||
@ -672,10 +669,10 @@ extern int call_c_function(int n)
|
||||
}
|
||||
|
||||
const char *lua = "local ffi = require(\"ffi\")\n"
|
||||
"ffi.cdef[[\n"
|
||||
"int call_c_function(int);\n"
|
||||
"]]\n"
|
||||
"f = ffi.C.call_c_function\n";
|
||||
"ffi.cdef[[\n"
|
||||
"int call_c_function(int);\n"
|
||||
"]]\n"
|
||||
"f = ffi.C.call_c_function\n";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@ -692,13 +689,16 @@ int main(int argc, char **argv)
|
||||
l_message("cannot create state: not enough memory");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (luaL_dostring(L, lua)) {
|
||||
printf("err: %s\n", lua_tostring(L, -1));
|
||||
}
|
||||
if (luaL_dostring(L, lua)) {
|
||||
printf("err: %s\n", lua_tostring(L, -1));
|
||||
}
|
||||
|
||||
smain.argc = argc;
|
||||
smain.argv = argv;
|
||||
|
||||
printf("Seccomps activated");
|
||||
fflush(stdout);
|
||||
|
||||
init_seccomp();
|
||||
status = lua_cpcall(L, pmain, NULL);
|
||||
report(L, status);
|
||||
|
Loading…
Reference in New Issue
Block a user