Commit 201f9be5 by Ned Batchelder

Try to find the sandbox in a few places.

parent 06673713
...@@ -14,24 +14,23 @@ from .util import temp_directory ...@@ -14,24 +14,23 @@ from .util import temp_directory
# TODO: limit too much stdout data? # TODO: limit too much stdout data?
DEBUG = False
STRICT = True
# Configure the Python command # Configure the Python command
SANDBOX_PYTHON = "/usr/bin/python-sandbox" SANDBOX_POSSIBILITIES = [
"~/mitx_all/python-sandbox/bin/python",
"/usr/bin/python-sandbox",
]
if os.path.exists(SANDBOX_PYTHON): for sandbox_python in SANDBOX_POSSIBILITIES:
# Python -S inhibits loading site.py, which prevent Ubuntu from adding sandbox_python = os.path.expanduser(sandbox_python)
# specialized traceback handlers that fail in the sandbox. if os.path.exists(sandbox_python):
PYTHON_CMD = [ PYTHON_CMD = [
'sudo', '-u', 'sandbox', 'sudo', '-u', 'sandbox',
SANDBOX_PYTHON, '-S' sandbox_python, '-E',
] ]
elif STRICT: break
raise Exception("Couldn't find Python sandbox")
else: else:
PYTHON_CMD = ['python', '-S'] raise Exception("Couldn't find Python sandbox")
class JailResult(object): class JailResult(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment