From 0240471e0de4e7eb464f27965bd29b79e1955908 Mon Sep 17 00:00:00 2001 From: raylu <90059+raylu@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:29:29 -0700 Subject: [PATCH] js: fix rlimit_as for node 20 --- code_eval.py | 2 +- mock_cmd.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code_eval.py b/code_eval.py index 8b6f33b..fa4aea3 100644 --- a/code_eval.py +++ b/code_eval.py @@ -6,7 +6,7 @@ def nodejs(cmd): args = ['../nsjail/nsjail', '--use_cgroupv2', '--cgroupv2_mount', '/sys/fs/cgroup/NSJAIL', '-Mo', - '--rlimit_as', '700', '--chroot', chroot_dir, + '--rlimit_as', '1000', '--chroot', chroot_dir, '-R/usr', '-R/lib', '-R/lib64', '--user', 'nobody', '--group', 'nogroup', '--time_limit', '2', '--disable_proc', '--iface_no_lo', '--cgroup_mem_max', str(50 * MB), '--cgroup_pids_max', '10', '--quiet', '--', diff --git a/mock_cmd.py b/mock_cmd.py index d052070..818d198 100755 --- a/mock_cmd.py +++ b/mock_cmd.py @@ -6,7 +6,7 @@ import requests import config -import poe +import code_eval class MockCmd: def __init__(self): @@ -14,7 +14,7 @@ def __init__(self): self.args = sys.argv[1] else: self.args = '' - self.sender = {'username': 'testname', 'id': '1'} + self.sender = {'username': 'testname', 'pretty_name': 'testname', 'id': '1'} self.channel_id = '1' self.bot = MockBot() @@ -52,4 +52,4 @@ def __init__(self): 'cats': {'position': 2, 'name': 'cats', 'color': 13369480, 'id': '2222'}, } -poe.price(MockCmd()) +code_eval.nodejs(MockCmd())