From 40520e4ebaec807e5e66e708cae05320b79fe7d4 Mon Sep 17 00:00:00 2001 From: Nicolas Setton Date: Mon, 16 Jul 2018 14:23:47 -0400 Subject: [PATCH] Use user "unprivileged" when launching commands --- compile_server/app/safe_run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile_server/app/safe_run.py b/compile_server/app/safe_run.py index 9e26c0b..87c4bbb 100644 --- a/compile_server/app/safe_run.py +++ b/compile_server/app/safe_run.py @@ -30,7 +30,7 @@ def safe_run(main): tmpdir = run(["mktemp", "-d"]) try: - run(["chown", "ubuntu", tmpdir]) + run(["chown", "unprivileged", tmpdir]) # Push the executable to the container subprocess.check_call(["lxc", "file", "push", main, @@ -41,7 +41,7 @@ def safe_run(main): # Run it, printint output to stdout as we go along subprocess.call(["lxc", "exec", CONT, "--", - "su", "ubuntu", "-c", + "su", "unprivileged", "-c", "timeout 20s {}".format( os.path.join(tmpdir, os.path.basename(main)))], stdout=sys.stdout)