From 6e88211e7e68a3cb23926a76d1c12fbc4f599ec2 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sun, 10 Jan 2021 14:18:18 -0800 Subject: Read the Python path and args from the config file --- snekbox/nsjail.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py index f5df64c..6972a40 100644 --- a/snekbox/nsjail.py +++ b/snekbox/nsjail.py @@ -37,9 +37,8 @@ class NsJail: See config/snekbox.cfg for the default NsJail configuration. """ - def __init__(self, nsjail_binary: str = NSJAIL_PATH, python_binary: str = sys.executable): + def __init__(self, nsjail_binary: str = NSJAIL_PATH): self.nsjail_binary = nsjail_binary - self.python_binary = python_binary self.config = self._read_config() self._create_parent_cgroups() @@ -154,7 +153,7 @@ class NsJail: "--config", NSJAIL_CFG, "--log", nsj_log.name, "--", - self.python_binary, "-Squ", "-c", code + self.config.exec_bin.path, *self.config.exec_bin.arg, "-c", code ) msg = "Executing code..." -- cgit v1.2.3