From ee12a1f5277424d55607904ebe2b994b35f3656c Mon Sep 17 00:00:00 2001 From: virusdefender Date: Fri, 10 Aug 2018 08:05:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=20testcase=20=E4=BD=BF=E7=94=A8=20nob?= =?UTF-8?q?ody=20700=20=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/entrypoint.sh | 1 + problem/views/admin.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/deploy/entrypoint.sh b/deploy/entrypoint.sh index 69404044..ee7e46da 100755 --- a/deploy/entrypoint.sh +++ b/deploy/entrypoint.sh @@ -60,4 +60,5 @@ done chown -R nobody:nogroup $DATA $APP/dist +chmod -R 700 $DATA/test_case exec supervisord -c /app/deploy/supervisord.conf diff --git a/problem/views/admin.py b/problem/views/admin.py index 31c7f597..7a719205 100644 --- a/problem/views/admin.py +++ b/problem/views/admin.py @@ -79,6 +79,11 @@ class TestCaseZipProcessor(object): with open(os.path.join(test_case_dir, "info"), "w", encoding="utf-8") as f: f.write(json.dumps(test_case_info, indent=4)) + + os.chmod(test_case_dir, 0o700) + for item in os.listdir(test_case_dir): + os.chmod(os.path.join(test_case_dir, item), 0o600) + return info, test_case_id def filter_name_list(self, name_list, spj, dir=""):