Skip to content

Commit 3147bc2

Browse files
committed
frenchroomaize
1 parent 7d9e7ff commit 3147bc2

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

vendor/nsjail/context/nsjail-user.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export CPU_SHARES_MS=${CPU_SHARES_MS:-50} # 50 ms per second of cpu per competit
2020
TMP_ENABLED=${TMP_ENABLED:-0}
2121
TMP_SIZE=${TMP_SIZE:-5000000}
2222

23+
echo "$FLAG" > /flag.txt
24+
2325
if [ $TMP_ENABLED -eq 1 ]; then
2426
export TMP_PARAMS=$(cat <<-END
2527
, {
@@ -45,6 +47,6 @@ fi
4547
if [ "$MODE" == "LISTEN_INJECT_FLAG" ]; then
4648
socat tcp-listen:$PORT,reuseaddr,fork "exec:/docker-init/inject-flag.sh"
4749
else
48-
nsjail --config <(echo "$CONFIG" | envsubst) --env FLAG
50+
nsjail --config <(echo "$CONFIG" | envsubst)
4951
fi
5052

vendor/nsjail/context/nsjail.cfg

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,19 @@ mount: [
6060
dst: "/usr",
6161
is_bind: true,
6262
rw: false
63-
}
63+
},
64+
{
65+
src: "/home/ctf/nix",
66+
dst: "/nix",
67+
is_bind: true,
68+
rw: false
69+
},
70+
{
71+
src: "/flag.txt",
72+
dst: "/flag.txt",
73+
is_bind: true,
74+
rw: false
75+
},
6476
$TMP_PARAMS
6577
]
6678

0 commit comments

Comments
 (0)