Skip to content

Commit 778e2ed

Browse files
vmcjmeisterTeldering
committed
Cleanup TMPDIR between testcases
Co-authored-by: Tobias Werth <[email protected]> Co-authored-by: Jaap Eldering <[email protected]>
1 parent 0de9b9c commit 778e2ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

judge/testcase_run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ runcheck "$RUN_SCRIPT" $RUNARGS \
212212
--stderr=program.err --outmeta=program.meta -- \
213213
"$PREFIX/$PROGRAM" 2>runguard.err
214214

215+
if [ "$CREATE_WRITABLE_TEMP_DIR" ]; then
216+
# Revoke access to the TMPDIR as security measure
217+
chown -R "$(id -un):" "$TMPDIR"
218+
chmod -R go= "$TMPDIR"
219+
fi
220+
215221
if [ $COMBINED_RUN_COMPARE -eq 0 ]; then
216222
# We first compare the output, so that even if the submission gets a
217223
# timelimit exceeded or runtime error verdict later, the jury can

0 commit comments

Comments
 (0)