Running libsandbox

前端 未结 3 1464
梦如初夏
梦如初夏 2021-01-22 12:40

I\'m currently working on an online C/C++/assembly compiler, and I stumbled upon a nice piece of software called libsandbox. This enables me to run the online written code, comp

3条回答
  •  迷失自我
    2021-01-22 13:32

    Totally agree with the answer from @user1401452. Some more tips about libsandbox,

    1. The binary executable to be sandboxed is better linked statically, because loading shared libraries involves system calls, like SYS_open(), that are forbidden by default.
    2. To write a C/C++ program directly invoking the core sandbox library (i.e. libsandbox) is also viable -- though a bit more complex than using the Pythonic wrapper (i.e. pysandbox). An ANSI C equivalent (i.e. sample2.c) of the sample python script is now available at libsandbox's homepage.
    3. The sample programs only demonstrate some essentials of libsandbox. Practical sandboxing solutions typically requires customized sandbox policies with more complex rules.

    DISCLAIMER: I am the author of libsandbox

提交回复
热议问题