aboutsummaryrefslogtreecommitdiffstats
path: root/testing/aaudit/aaudit-shell
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-05-10 19:13:15 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-05-10 19:13:43 +0300
commit99cbabfef1e156ff608c4166a8dec0ce8b5a3a0a (patch)
treefb609f8c4d8274e7beff80783c372d2a16d4c234 /testing/aaudit/aaudit-shell
parentb4d9865b4a688624679d5aa1d633b755db34c9e5 (diff)
downloadaports-99cbabfef1e156ff608c4166a8dec0ce8b5a3a0a.tar.bz2
aports-99cbabfef1e156ff608c4166a8dec0ce8b5a3a0a.tar.xz
main/aaudit: variouts optimizations, and improvements
Diffstat (limited to 'testing/aaudit/aaudit-shell')
-rwxr-xr-xtesting/aaudit/aaudit-shell10
1 files changed, 7 insertions, 3 deletions
diff --git a/testing/aaudit/aaudit-shell b/testing/aaudit/aaudit-shell
index e54ac3a977..733341bae9 100755
--- a/testing/aaudit/aaudit-shell
+++ b/testing/aaudit/aaudit-shell
@@ -3,9 +3,13 @@
local json = require 'cjson'
local aas = require 'aaudit.server'
-local req = json.decode(io.read("*all"))
+local req = json.decode(io.read())
req.remote_ip = (os.getenv("SSH_CLIENT") or ""):match("[^ ]+")
req.identity = arg[1]
-local ok, msg = aas.handle(req)
-print(json.encode{ok=ok,msg=msg})
+local ok, msg, extra = aas.handle(req, io.stdin)
+
+local object = extra or {}
+object.ok = ok
+object.msg = msg
+print(json.encode(object))