sio2project / sio2jail

A tool for supervising execution of programs submitted in algorithmic competitions
MIT License
29 stars 10 forks source link

Add option to chdir() before running the target program #15

Closed Wolf480pl closed 1 year ago

Wolf480pl commented 5 years ago

It'd be useful, especially when using the -B option, to be able to change the working directory inside the sandbox before running the target program.

So that we could do something like sio2jail -b /my/empty/chroot:/:ro -b .:/tmp:ro --chdir /tmp -B ./abc instead of sio2jail -b /my/empty/chroot:/:ro -b .:/tmp:ro -B /tmp/abc

Or sio2jail -b /my/python/chroot:/:ro -b .:/tmp:ro --chdir /tmp -B python abc.py instead of PYTHONPATH=/tmp sio2jail -b /my/python/chroot:/:ro -b .:/tmp:ro -B python /tmp/abc.py