Repository navigation
Commit 682ffe1
committed
fix(sandbox): derive the sandbox PATH from the runner's PATH
setup-sandbox.sh runs as the runner user, whose PATH already lists every
toolchain dir the runner image seeded — /etc/skel language homes (.cargo/bin,
.dotnet/tools, .config/composer/vendor/bin, …) plus system dirs (/opt/pipx_bin,
/usr/local/.ghcup/bin, …). useradd -m copies /etc/skel into the sandbox's own
home, so each runner-home toolchain has a sibling under the sandbox home.
Rewrite a leading /home/runner -> the sandbox home for each PATH entry and keep
it only when it now exists and the sandbox UID can traverse it, instead of
hardcoding a base set with per-language special cases. This brings every seeded
toolchain (cargo, dotnet, ghcup, composer, …) across on one rule — no
per-language allowlist to grow.
Security: only runner-home prefixes are rewritten to the sandbox's own copies;
a raw /home/runner path is never kept (bare home dropped, every kept dir
re-tested with `sudo -u sandbox test -x`), so the sandbox still cannot traverse
the runner home where the real credentials live.
Tools an adopter installs at runtime in a setup: step land in the runner's home,
not /etc/skel, so they're absent from the sandbox home and this rewrite finds
nothing to point at — reaching those still needs the sandbox-setup lever in #766.
Refs #7661 parent e127227 commit 682ffe1
1 file changed
Lines changed: 51 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
94 | 144 | | |
95 | 145 | | |
96 | | - | |
| 146 | + | |
97 | 147 | | |
98 | 148 | | |
99 | 149 | | |
| |||
0 commit comments