Skip to content

Commit

Permalink
Allow Java access to all parent directories of agent
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Sep 5, 2021
1 parent 31a4862 commit e20c1d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dmoj/executors/java_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import subprocess
import sys
from collections import deque
from pathlib import PurePath
from typing import Optional

from dmoj.error import CompileError, InternalError
Expand Down Expand Up @@ -81,7 +82,8 @@ def get_executable(self):
return self.get_vm()

def get_fs(self):
return super().get_fs() + [self._agent_file]
return super().get_fs() + [f'{re.escape(self._agent_file)}$'] + \
[f'{re.escape(str(parent))}$' for parent in PurePath(self._agent_file).parents]

def get_write_fs(self):
return super().get_write_fs() + [os.path.join(self._dir, 'submission_jvm_crash.log')]
Expand Down

0 comments on commit e20c1d6

Please sign in to comment.