Skip to content

Commit 2172a02

Browse files
committed
luacov doesn't use io.popen anymore
1 parent 2e8e12b commit 2172a02

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

depends/luacov

library/LuaTools.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,13 +1898,11 @@ lua_State *DFHack::Lua::Open(color_ostream &out, lua_State *state)
18981898
luaL_setfuncs(state, dfhack_coro_funcs, 0);
18991899
lua_pop(state, 1);
19001900

1901-
// remove some io functions (if coverage monitoring, which needs them, is not enabled)
1902-
if (!getenv("DFHACK_ENABLE_LUACOV")) {
1903-
lua_getglobal(state, "io");
1904-
lua_pushnil(state);
1905-
lua_setfield(state, -2, "popen");
1906-
lua_pop(state, 1);
1907-
}
1901+
// DFHack should not be running external processes (security hardening measure)
1902+
lua_getglobal(state, "io");
1903+
lua_pushnil(state);
1904+
lua_setfield(state, -2, "popen");
1905+
lua_pop(state, 1);
19081906

19091907
// replace some os functions
19101908
lua_getglobal(state, "os");

0 commit comments

Comments
 (0)