Skip to content

Commit

Permalink
Make executors work after #188
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Jul 6, 2016
1 parent fb5aed6 commit 565b430
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dmoj/executors/COFFEE.py
Expand Up @@ -10,7 +10,7 @@ class Executor(ScriptExecutor):
fs = ['.*\.js$', '/etc/(?:resolv|nsswitch).conf$']
command = 'node'
syscalls = ['newselect', 'select', 'pipe2', 'write', 'epoll_create1',
'eventfd2', 'epoll_ctl', 'epoll_wait']
'eventfd2', 'epoll_ctl', 'epoll_wait', 'sched_yield', 'restart_syscall']
test_program = '''\
process.stdin.on 'readable', () ->
chunk = process.stdin.read()
Expand All @@ -29,7 +29,7 @@ def get_cmdline(self):
return [self.get_command(), self.runtime_dict['coffee'], self._code]

def get_fs(self):
return super(Executor, self).get_fs() + [self.runtime_dict['coffee']]
return super(Executor, self).get_fs() + [self.runtime_dict['coffee'], self._code]

@classmethod
def get_find_first_mapping(cls):
Expand Down
2 changes: 1 addition & 1 deletion dmoj/executors/DART.py
Expand Up @@ -13,7 +13,7 @@ class Executor(ScriptExecutor):
'''
address_grace = 786432

syscalls = ['epoll_create', 'epoll_ctl',
syscalls = ['epoll_create', 'epoll_ctl', 'epoll_wait',
('write', lambda debugger: debugger.uarg0 <= 4)]

fs = ['.*\.(so|dart)', '/proc/meminfo$', '/dev/urandom$']
2 changes: 1 addition & 1 deletion dmoj/executors/RUBY21.py
Expand Up @@ -6,7 +6,7 @@
class Executor(RubyExecutor):
name = 'RUBY21'
command_paths = ['ruby2.1']
syscalls = ['pipe2', ('write', lambda debugger: debugger.arg0 in (1, 2, 4))]
syscalls = ['pipe2', 'poll', ('write', lambda debugger: debugger.arg0 in (1, 2, 4))]

def get_nproc(self):
return [-1, 1][os.name == 'nt']
2 changes: 1 addition & 1 deletion dmoj/executors/TCL.py
Expand Up @@ -7,7 +7,7 @@ class Executor(ScriptExecutor):
nproc = -1 # TCL uses a bunch of threads internally
address_grace = 131072
command = 'tclsh'
syscalls = ['connect', 'access', 'getsockname',
syscalls = ['connect', 'access', 'getsockname', 'select',
# TCL uses some handles internally
('write', lambda debugger: debugger.arg0 <= 4)]
fs = ['.*\.tcl', '/etc/nsswitch\.conf$', '/etc/passwd$']
Expand Down
1 change: 1 addition & 0 deletions dmoj/executors/mono_executor.py
Expand Up @@ -36,6 +36,7 @@ def get_security(self, launch_kwargs=None):
sec[sys_statfs] = ALLOW
sec[sys_ftruncate64] = ALLOW
sec[sys_sched_yield] = ALLOW
sec[sys_rt_sigsuspend] = ALLOW

fs = sec.fs_jail
write_fs = re.compile('|'.join(WRITE_FS))
Expand Down

0 comments on commit 565b430

Please sign in to comment.