0

I am tring to run a Python code in PyPy sandbox. I need to get output from the script which doesn't interfere with the stdout.

I've read a lot of sources and most of them mentions, that sanboxed script can write files to virtual /tmp. However I am not able to achieve that (all the sources are missing example).

If the write access to /tmp isn't possible, is it possible to open pipe between the sanboxed script and the control script?

If none of this is possible, could I write binary data to stdout? I'd like to tag the begginning and the ending of the output in stdout, so the control script could distinguish what is user output and what is my output.

yaqwsx
  • 569
  • 1
  • 5
  • 14

1 Answers1

0

The virtual /tmp is read-only; in fact any attempt by the subprocess to write any file will be denied. If you want to change that, you could edit the sources that control the outer process, which so far refuse any attempt to write. Start with do_ll_os__ll_os_open in rpython/translator/sandbox/sandlib.py.

Armin Rigo
  • 12,048
  • 37
  • 48