diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2014-06-12 07:56:57 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2014-06-12 07:57:18 +0000 |
commit | 15f898ca8068419fc02364231bb2981cc54971cb (patch) | |
tree | e3ec5995d70831834d467d40615870b44bca7044 /main/aaudit/aaudit-shell | |
parent | 94983a506d2e95be0a5864ae7bcc7d7d61dc6cce (diff) | |
download | aports-15f898ca8068419fc02364231bb2981cc54971cb.tar.bz2 aports-15f898ca8068419fc02364231bb2981cc54971cb.tar.xz |
testing/aaudit: move to main
Diffstat (limited to 'main/aaudit/aaudit-shell')
-rwxr-xr-x | main/aaudit/aaudit-shell | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/main/aaudit/aaudit-shell b/main/aaudit/aaudit-shell new file mode 100755 index 0000000000..733341bae9 --- /dev/null +++ b/main/aaudit/aaudit-shell @@ -0,0 +1,15 @@ +#!/usr/bin/lua5.2 + +local json = require 'cjson' +local aas = require 'aaudit.server' + +local req = json.decode(io.read()) +req.remote_ip = (os.getenv("SSH_CLIENT") or ""):match("[^ ]+") +req.identity = arg[1] + +local ok, msg, extra = aas.handle(req, io.stdin) + +local object = extra or {} +object.ok = ok +object.msg = msg +print(json.encode(object)) |