diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-16 13:11:29 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-16 15:59:20 +0100 |
commit | 1e07eccace7c50fd0e7fa3b217eda85add5a6630 (patch) | |
tree | 185ea94c8d009fbf98bdfb0c544bc37094c34ea3 /bin/lua-privsep.c | |
parent | 4ec833f0356b16149f3005d2d8500d3444b938ed (diff) | |
download | privsep-1e07eccace7c50fd0e7fa3b217eda85add5a6630.tar.bz2 privsep-1e07eccace7c50fd0e7fa3b217eda85add5a6630.tar.xz |
privsep-server: use libev and unix sockets for the server
Diffstat (limited to 'bin/lua-privsep.c')
-rw-r--r-- | bin/lua-privsep.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/lua-privsep.c b/bin/lua-privsep.c index 1e165e1..0307d7c 100644 --- a/bin/lua-privsep.c +++ b/bin/lua-privsep.c @@ -32,7 +32,7 @@ static int traceback (lua_State *L) { return 1; } -int main(int argc, char *argv[]) +int call_lua(const char *msg, size_t msglen) { const char *luamain = PRIVSEP_PATH "privileged-main.lua"; int i, traceback_index; @@ -46,10 +46,9 @@ int main(int argc, char *argv[]) if (luaL_loadfile(L, luamain)) return luaL_error(L, "%s", luamain); - for (i = 1; i < argc; i++) - lua_pushstring(L, argv[i]); + lua_pushlstring(L, msg, msglen); - if (lua_pcall(L, argc-1, 0, traceback_index)) + if (lua_pcall(L, 1, 0, traceback_index)) return luaL_error(L, "error"); |