From 84a99cccd17d6a058e30a01605843cc88dff33a9 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 13 Dec 2012 21:43:11 +0100 Subject: Use data format agnostic namespace for ipc message encode/decode --- privsep.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/privsep.lua b/privsep.lua index de4087a..5e0b915 100644 --- a/privsep.lua +++ b/privsep.lua @@ -1,6 +1,6 @@ lpc = require("lpc") -json = require("json") +ipcmsg = require("json") local privsep_exec = "./lua-privsep" local modules_path = "./modules" @@ -8,7 +8,7 @@ local modules_path = "./modules" local privsep = {} function privsep.call_privileged(modname, funcname, sessionid, args) local pid, w, r = lpc.run(privsep_exec, modname) - w:write(json.encode{ funcname, sessionid, args }.."\n") + w:write(ipcmsg.encode{ funcname, sessionid, args }.."\n") w:close() local resp = r:read("*all") @@ -19,7 +19,7 @@ function privsep.call_privileged(modname, funcname, sessionid, args) return nil end - local data = json.decode(resp) + local data = ipcmsg.decode(resp) local status, errmsg, result = unpack(data) if not status then io.stderr:write("modname: "..tostring(errmsg).."\n") -- cgit v1.2.3