From e1ef091570f4e9562faeb50390083b60ae4f50c9 Mon Sep 17 00:00:00 2001 From: ThreshMain Date: Fri, 5 Feb 2021 16:50:57 +0100 Subject: [PATCH] Removed unnecessary argument from execute and executors --- lxc/execute | 2 +- lxc/executors/awk | 3 ++- lxc/executors/bash | 2 +- lxc/executors/brainfuck | 2 +- lxc/executors/c | 2 +- lxc/executors/cpp | 2 +- lxc/executors/crystal | 2 +- lxc/executors/csharp | 2 +- lxc/executors/d | 2 +- lxc/executors/dash | 2 +- lxc/executors/deno | 2 +- lxc/executors/elixir | 2 +- lxc/executors/emacs | 2 +- lxc/executors/go | 2 +- lxc/executors/haskell | 2 +- lxc/executors/jelly | 2 +- lxc/executors/julia | 2 +- lxc/executors/kotlin | 2 +- lxc/executors/lisp | 2 +- lxc/executors/lua | 2 +- lxc/executors/nasm | 2 +- lxc/executors/nasm64 | 2 +- lxc/executors/nim | 2 +- lxc/executors/node | 2 +- lxc/executors/osabie | 2 +- lxc/executors/paradoc | 2 +- lxc/executors/perl | 2 +- lxc/executors/php | 2 +- lxc/executors/python2 | 2 +- lxc/executors/python3 | 2 +- lxc/executors/ruby | 2 +- lxc/executors/rust | 2 +- lxc/executors/swift | 2 +- lxc/executors/typescript | 2 +- lxc/executors/zig | 2 +- 35 files changed, 36 insertions(+), 35 deletions(-) diff --git a/lxc/execute b/lxc/execute index 40d1797..66e1daf 100755 --- a/lxc/execute +++ b/lxc/execute @@ -35,7 +35,7 @@ lxc-attach --clear-env -n piston -- \ # runner timeout -s KILL 20 \ lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c "runuser runner$runner /exec/$language runner$runner $id" + /bin/bash -l -c "runuser runner$runner /exec/$language $id" # process janitor lxc-attach --clear-env -n piston -- \ diff --git a/lxc/executors/awk b/lxc/executors/awk index 395424f..319a64e 100755 --- a/lxc/executors/awk +++ b/lxc/executors/awk @@ -1,4 +1,5 @@ #!/bin/bash -cd /tmp/$2 + +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' awk -f code.code < stdin.stdin diff --git a/lxc/executors/bash b/lxc/executors/bash index 6aeb899..8685011 100755 --- a/lxc/executors/bash +++ b/lxc/executors/bash @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 xargs -a args.args -d '\n' timeout -s KILL 3 bash code.code < stdin.stdin diff --git a/lxc/executors/brainfuck b/lxc/executors/brainfuck index 7ec1bfe..eb9725d 100755 --- a/lxc/executors/brainfuck +++ b/lxc/executors/brainfuck @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' brainfuck code.code < stdin.stdin diff --git a/lxc/executors/c b/lxc/executors/c index 719062a..e0806f3 100755 --- a/lxc/executors/c +++ b/lxc/executors/c @@ -1,5 +1,5 @@ #!/usr/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/cpp b/lxc/executors/cpp index 9f7ef27..0365b00 100755 --- a/lxc/executors/cpp +++ b/lxc/executors/cpp @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 10 g++ -std=c++17 -o binary -x c++ code.code timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/crystal b/lxc/executors/crystal index a3ce996..ec8fe01 100644 --- a/lxc/executors/crystal +++ b/lxc/executors/crystal @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 10 crystal build code.code timeout -s KILL 3 xargs -a args.args -d '\n' ./code < stdin.stdin diff --git a/lxc/executors/csharp b/lxc/executors/csharp index f35c876..684beb9 100755 --- a/lxc/executors/csharp +++ b/lxc/executors/csharp @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 mcs $(echo code.code | sed 's/\///') -nowarn:0219 -out:binary timeout -s KILL 3 xargs -a args.args -d '\n' mono binary < stdin.stdin diff --git a/lxc/executors/d b/lxc/executors/d index 15e155d..8893762 100644 --- a/lxc/executors/d +++ b/lxc/executors/d @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 cp code.code code.d timeout -s KILL 10 dmd code.d timeout -s KILL 3 xargs -a args.args -d '\n' ./code diff --git a/lxc/executors/dash b/lxc/executors/dash index cf20c38..4476310 100644 --- a/lxc/executors/dash +++ b/lxc/executors/dash @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 xargs -a args.args -d '\n' timeout -s KILL 3 dash code.code < stdin.stdin diff --git a/lxc/executors/deno b/lxc/executors/deno index 31132fa..f55e1f4 100755 --- a/lxc/executors/deno +++ b/lxc/executors/deno @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin diff --git a/lxc/executors/elixir b/lxc/executors/elixir index 1a8e23f..2f36aa9 100755 --- a/lxc/executors/elixir +++ b/lxc/executors/elixir @@ -2,5 +2,5 @@ export LC_ALL="en_US.UTF-8" -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' elixir code.code < stdin.stdin diff --git a/lxc/executors/emacs b/lxc/executors/emacs index ab41624..efcac97 100755 --- a/lxc/executors/emacs +++ b/lxc/executors/emacs @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' emacs -Q --script code.code < stdin.stdin diff --git a/lxc/executors/go b/lxc/executors/go index 09c1e68..41592f7 100755 --- a/lxc/executors/go +++ b/lxc/executors/go @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 cp code.code interim.go go build interim.go timeout -s KILL 3 xargs -a args.args -d '\n' ./interim < stdin.stdin diff --git a/lxc/executors/haskell b/lxc/executors/haskell index df517d9..ad62cab 100755 --- a/lxc/executors/haskell +++ b/lxc/executors/haskell @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 cp code.code code.hs ghc -dynamic -o binary code.hs > /dev/null 2>&1 timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/jelly b/lxc/executors/jelly index 945444e..6d83412 100755 --- a/lxc/executors/jelly +++ b/lxc/executors/jelly @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' jelly fu code.code < stdin.stdin diff --git a/lxc/executors/julia b/lxc/executors/julia index e8b4ea5..1d4ba09 100755 --- a/lxc/executors/julia +++ b/lxc/executors/julia @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' julia code.code < stdin.stdin diff --git a/lxc/executors/kotlin b/lxc/executors/kotlin index c304575..a144851 100755 --- a/lxc/executors/kotlin +++ b/lxc/executors/kotlin @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 cp code.code code.kt kotlinc code.kt -include-runtime -d code.jar timeout -s KILL 3 xargs -a args.args -d '\n' java -jar code.jar < stdin.stdin diff --git a/lxc/executors/lisp b/lxc/executors/lisp index 6453985..d65e94a 100644 --- a/lxc/executors/lisp +++ b/lxc/executors/lisp @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' sbcl --script code.code < stdin.stdin diff --git a/lxc/executors/lua b/lxc/executors/lua index 4caa4b6..7c50781 100755 --- a/lxc/executors/lua +++ b/lxc/executors/lua @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' lua code.code < stdin.stdin diff --git a/lxc/executors/nasm b/lxc/executors/nasm index ffe8fd0..8c9b13f 100755 --- a/lxc/executors/nasm +++ b/lxc/executors/nasm @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 nasm -f elf32 -o binary.o code.code ld -m elf_i386 binary.o -o binary timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/nasm64 b/lxc/executors/nasm64 index 98c2aab..44d8aa2 100755 --- a/lxc/executors/nasm64 +++ b/lxc/executors/nasm64 @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 nasm -f elf64 -o binary.o code.code ld -m elf_x86_64 binary.o -o binary timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/nim b/lxc/executors/nim index 8b5b1c1..51c1fee 100644 --- a/lxc/executors/nim +++ b/lxc/executors/nim @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 10 nim --hints:off c code.code timeout -s KILL 3 xargs -a args.args -d '\n' ./code diff --git a/lxc/executors/node b/lxc/executors/node index 3262b53..b69940b 100755 --- a/lxc/executors/node +++ b/lxc/executors/node @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' node code.code < stdin.stdin diff --git a/lxc/executors/osabie b/lxc/executors/osabie index ff8ab84..cb66947 100644 --- a/lxc/executors/osabie +++ b/lxc/executors/osabie @@ -4,5 +4,5 @@ export LC_ALL="en_US.UTF-8" # osabie will break if you try using it with xargs -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 osabie code.code < args.args diff --git a/lxc/executors/paradoc b/lxc/executors/paradoc index f82630a..f4398a3 100755 --- a/lxc/executors/paradoc +++ b/lxc/executors/paradoc @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 export PYTHONPATH=$PYTHONPATH:/opt/paradoc timeout -s KILL 3 python3.8 -m paradoc code.code < args.args diff --git a/lxc/executors/perl b/lxc/executors/perl index 8b65855..af78971 100755 --- a/lxc/executors/perl +++ b/lxc/executors/perl @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' perl code.code < stdin.stdin diff --git a/lxc/executors/php b/lxc/executors/php index 9f21f7b..5c37306 100755 --- a/lxc/executors/php +++ b/lxc/executors/php @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' php code.code < stdin.stdin diff --git a/lxc/executors/python2 b/lxc/executors/python2 index 5fa1c3e..54db44c 100755 --- a/lxc/executors/python2 +++ b/lxc/executors/python2 @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' python code.code < stdin.stdin diff --git a/lxc/executors/python3 b/lxc/executors/python3 index 6cb93f8..9f4bd58 100755 --- a/lxc/executors/python3 +++ b/lxc/executors/python3 @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' python3.8 code.code < stdin.stdin diff --git a/lxc/executors/ruby b/lxc/executors/ruby index ebb9b06..7f64386 100755 --- a/lxc/executors/ruby +++ b/lxc/executors/ruby @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' ruby code.code < stdin.stdin diff --git a/lxc/executors/rust b/lxc/executors/rust index 6be216a..56a7c02 100755 --- a/lxc/executors/rust +++ b/lxc/executors/rust @@ -1,5 +1,5 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 10 rustc -o binary code.code timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/swift b/lxc/executors/swift index a8327f7..96c8830 100755 --- a/lxc/executors/swift +++ b/lxc/executors/swift @@ -1,4 +1,4 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 timeout -s KILL 3 xargs -a args.args -d '\n' swift code.code < stdin.stdin diff --git a/lxc/executors/typescript b/lxc/executors/typescript index 8c1873d..b671996 100755 --- a/lxc/executors/typescript +++ b/lxc/executors/typescript @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 mv code.code interim.ts tsc interim.ts rm -f interim.ts diff --git a/lxc/executors/zig b/lxc/executors/zig index 1250342..b046672 100644 --- a/lxc/executors/zig +++ b/lxc/executors/zig @@ -1,6 +1,6 @@ #!/bin/bash -cd /tmp/$2 +cd /tmp/$1 cp code.code main.zig timeout -s KILL 10 zig build-exe main.zig timeout -s KILL 3 xargs -a args.args -d '\n' ./main