Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Forbid usage of os.exit in lua
Baptiste Daroussin committed 5 years ago
commit 08432523df4bc3c7b6160fcb4a37857197b3a00c
parent b3b2224
1 file changed +8 -0
modified libpkg/lua.c
@@ -412,6 +412,12 @@ lua_os_execute(lua_State *L)
	return (luaL_error(L, "os.execute not available"));
}

+
static int
+
lua_os_exit(lua_State *L)
+
{
+
	return (luaL_error(L, "os.exit not available"));
+
}
+

void
lua_override_ios(lua_State *L)
{
@@ -426,4 +432,6 @@ lua_override_ios(lua_State *L)
	lua_setfield(L, -2, "rename");
	lua_pushcfunction(L, lua_os_execute);
	lua_setfield(L, -2, "execute");
+
	lua_pushcfunction(L, lua_os_exit);
+
	lua_setfield(L, -2, "exit");
}