how to execute c code securely

前端 未结 4 476
有刺的猬
有刺的猬 2021-01-28 11:46

In this scenario the user will submit his/her C code to my server through a browser. The code will then be compiled and executed on my server and the output will be sent to the

4条回答
  •  孤城傲影
    2021-01-28 12:02

    I cannot answer you for windows -- I can tell you for linux.

    This is an extremly complex problem. You need to think to:

    • quota limit
    • process that compiles/executes the code to be runned as an unprivileged user.
    • do not allow the process to run more than N seconds
    • do not allow process to allocate too much memory

    I can say that this is a long-term project that you can not finish correctly in a few weeks.

提交回复
热议问题