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",
if os.path.exists(SANDBOX_PYTHON): "/usr/bin/python-sandbox",
# Python -S inhibits loading site.py, which prevent Ubuntu from adding ]
# specialized traceback handlers that fail in the sandbox.
PYTHON_CMD = [ for sandbox_python in SANDBOX_POSSIBILITIES:
'sudo', '-u', 'sandbox', sandbox_python = os.path.expanduser(sandbox_python)
SANDBOX_PYTHON, '-S' if os.path.exists(sandbox_python):
] PYTHON_CMD = [
elif STRICT: 'sudo', '-u', 'sandbox',
raise Exception("Couldn't find Python sandbox") sandbox_python, '-E',
]
break
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