fix problem with multiple args

This commit is contained in:
Brian Seymour 2019-06-19 00:09:56 -05:00
parent 31a90fe3ad
commit 460e393772
16 changed files with 20 additions and 20 deletions

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 bash code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 bash code.code"

View File

@ -1,3 +1,3 @@
cd /tmp/$2
timeout -s KILL 10 gcc -o binary -x c code.code
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ./binary"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -1,3 +1,3 @@
cd /tmp/$2
timeout -s KILL 10 g++ -o binary -x c++ code.code
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ./binary"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -1,3 +1,3 @@
cd /tmp/$2
timeout -s KILL 10 mcs $(echo code.code | sed 's/\///') -nowarn:0219 -out:binary
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 mono binary"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 mono binary"

View File

@ -3,4 +3,4 @@ cp code.code interim.go
file="interim.go"
GOROOT=/usr/lib/go timeout -s KILL 10 go build $file
file=${file%%.*}
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ./$file"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./$file"

View File

@ -3,4 +3,4 @@ cp code.code interim.java
name=$(cat interim.java | grep -Eo 'public\s+class\s+([A-Za-z0-9]+)' | sed -n 's/ */ /gp' | cut -d' ' -f3)
mv interim.java $name.java
timeout -s KILL 10 javac $name.java
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 java $name"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name"

View File

@ -1,4 +1,4 @@
cd /tmp/$2
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code
timeout -s KILL 10 ld binary.o -o binary
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ./binary"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 nodejs code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 nodejs code.code"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 php code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 php code.code"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 python2 code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python2 code.code"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 python3.6 code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3.6 code.code"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 Rscript code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 Rscript code.code"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ruby code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ruby code.code"

View File

@ -1,3 +1,3 @@
cd /tmp/$2
timeout -s KILL 10 rustc -o binary code.code
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 ./binary"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -1,2 +1,2 @@
cd /tmp/$2
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs timeout -s KILL 3 swift code.code"
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 swift code.code"

View File

@ -30,6 +30,7 @@ lxc-create -t download -n piston -- --dist ubuntu --release bionic --arch amd64
./shell
# install all necessary piston dependencies
export HOME=/opt
echo 'export PATH=/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin' >> /root/.bashrc
echo 'export PATH=$PATH:/root/.cargo/bin' >> /root/.bashrc
sed -i \
@ -40,14 +41,13 @@ apt-get -y install git tzdata nano \
dpkg-dev build-essential python python3 \
ruby nodejs golang php7.2 r-base mono-complete \
nasm openjdk-8-jdk ubuntu-make bf
mkdir -p /root/.local/share/umake/swift/swift-lang
umake swift
ln -s /root/.local/share/umake/swift/swift-lang/usr/bin/swift /usr/bin/swift
curl https://sh.rustup.rs -sSf | sh
ln -s /root/.cargo/bin/rustc /usr/bin/rustc
ln -s /opt/.local/share/umake/swift/swift-lang/usr/bin/swift /usr/bin/swift
curl https://sh.rustup.rs > rust.sh
sh rust.sh -y
ln -s /opt/.cargo/bin/rustc /usr/bin/rustc
rm -rf /home/ubuntu
chmod 777 /tmp
chmod 777 -R /root
# create runnable users and apply limits
for i in {1..150}; do