diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-12-25 08:18:53 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-12-25 08:22:15 -0800 |
commit | 1b25d58a4f6d7aab8065f848f3fb7327f91e3738 (patch) | |
tree | be5a47352cf579c463ed0e60849059db9bc613b3 /src | |
parent | 3964dd5f574c90d6f8d89626645f43ece36bad31 (diff) | |
download | teliva-1b25d58a4f6d7aab8065f848f3fb7327f91e3738.tar.gz |
sandbox: no system()
Too hard to sandbox. Maybe we'll get back to it if there's some use case only it can satisfy.
Diffstat (limited to 'src')
-rw-r--r-- | src/loslib.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/loslib.c b/src/loslib.c index da06a57..6971d34 100644 --- a/src/loslib.c +++ b/src/loslib.c @@ -35,12 +35,6 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { } -static int os_execute (lua_State *L) { - lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); - return 1; -} - - static int os_remove (lua_State *L) { const char *filename = luaL_checkstring(L, 1); return os_pushresult(L, remove(filename) == 0, filename); @@ -221,7 +215,7 @@ static const luaL_Reg syslib[] = { {"clock", os_clock}, {"date", os_date}, {"difftime", os_difftime}, - {"execute", os_execute}, + /* no execute without sandboxing it */ {"exit", os_exit}, {"getenv", os_getenv}, {"remove", os_remove}, |