From 4861376841997db2153e4d998b877fbcf8407681 Mon Sep 17 00:00:00 2001 From: "volltin@live.com" Date: Fri, 17 Mar 2017 16:15:16 +0800 Subject: [PATCH] fix include attack avoid `#include "/test_case/1000/1.in"` --- docker-compose.example.yml | 2 +- server/run.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.example.yml b/docker-compose.example.yml index 571f011..2c1dad7 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -15,7 +15,7 @@ services: - /judger_run:exec,mode=777 - /spj:exec,mode=777 volumes: - - $PWD/tests/test_case:/test_case:ro + - $PWD/tests/test_case:/test_case - /data/log:/log - $PWD/server:/code:ro - $PWD/token.txt:/token.txt diff --git a/server/run.sh b/server/run.sh index f57a3ef..021a6f5 100644 --- a/server/run.sh +++ b/server/run.sh @@ -4,4 +4,5 @@ echo 0 > /tmp/counter core=$(grep --count ^processor /proc/cpuinfo) n=$(($core*4)) chmod 400 /token.txt /tmp/counter +chmod -R 400 /test_case gunicorn --workers $n --threads $n --error-logfile /log/gunicorn.log --time 600 --bind 0.0.0.0:8080 server:wsgiapp \ No newline at end of file