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"