From 27f444371919d5740a02ec9d6a4aba0c57128574 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sat, 8 Dec 2018 11:06:01 -0600 Subject: [PATCH] update piston --- api/main.go | 1 + lxc/execute | 3 +++ lxc/executors/brainfuck | 2 ++ 3 files changed, 6 insertions(+) create mode 100755 lxc/executors/brainfuck diff --git a/api/main.go b/api/main.go index 22945dc..5ff0d8a 100644 --- a/api/main.go +++ b/api/main.go @@ -71,6 +71,7 @@ func Execute(res http.ResponseWriter, req *http.Request) { "r", "ruby", "swift", + "brainfuck", "bf", } // check if the supplied language is supported diff --git a/lxc/execute b/lxc/execute index 2006564..bc9e658 100755 --- a/lxc/execute +++ b/lxc/execute @@ -81,6 +81,9 @@ case "$lang" in "swift") bin=swift ;; +"brainfuck" | "bf") + bin=brainfuck + ;; *) echo "invalid language" exit diff --git a/lxc/executors/brainfuck b/lxc/executors/brainfuck new file mode 100755 index 0000000..6944661 --- /dev/null +++ b/lxc/executors/brainfuck @@ -0,0 +1,2 @@ +cd /tmp/$2 +runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 bf code.code"