Commit d9df65ee by Ned Batchelder

Add some logging to codejail

parent 771de938
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Instructions: # Instructions:
# - AppArmor.md from xserver # - AppArmor.md from xserver
import logging
import os, os.path import os, os.path
import resource import resource
import shutil import shutil
...@@ -13,6 +14,8 @@ import time ...@@ -13,6 +14,8 @@ import time
from .util import temp_directory from .util import temp_directory
log = logging.getLogger(__name__)
# TODO: limit too much stdout data? # TODO: limit too much stdout data?
# Configure the Python command # Configure the Python command
...@@ -61,6 +64,8 @@ def jailpy(code, files=None, argv=None, stdin=None): ...@@ -61,6 +64,8 @@ def jailpy(code, files=None, argv=None, stdin=None):
with temp_directory(delete_when_done=True) as tmpdir: with temp_directory(delete_when_done=True) as tmpdir:
log.debug("Executing jailed code: %r", code)
# All the supporting files are copied into our directory. # All the supporting files are copied into our directory.
for filename in files or (): for filename in files or ():
if os.path.isfile(filename): if os.path.isfile(filename):
......
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