Commit c085a77
fix(clawhub): prevent temp workspace from chmod'ing shared /tmp to 0700
When createTempDownloadTarget is called with tmpDir: os.tmpdir(),
the @openclaw/fs-safe tempWorkspace helper calls ensurePrivateDirectory
which unconditionally chmods the root directory to 0700. Passing /tmp
as rootDir causes the shared system /tmp to be chmod'd, breaking all
other services that depend on world-writable /tmp (MySQL, PHP-FPM, etc.).
- Remove 5 explicit tmpDir: os.tmpdir() overrides from clawhub.ts
download functions, letting createTempDownloadTarget use its safe
default resolvePreferredOpenClawTmpDir() which resolves to the
OpenClaw-owned /tmp/openclaw directory.
- Change withTempDir default rootDir from os.tmpdir() to
resolvePreferredOpenClawTmpDir() so all callers that don't pass an
explicit rootDir are safe.
- Add regression test verifying temp dirs are created under the
OpenClaw-owned temp root, not directly under /tmp.
Fixes #101224
Co-Authored-By: Claude <[email protected]>1 parent c64fa18 commit c085a77
3 files changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1385 | 1385 | | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | | - | |
1389 | 1388 | | |
1390 | 1389 | | |
1391 | 1390 | | |
| |||
1428 | 1427 | | |
1429 | 1428 | | |
1430 | 1429 | | |
1431 | | - | |
1432 | 1430 | | |
1433 | 1431 | | |
1434 | 1432 | | |
| |||
1475 | 1473 | | |
1476 | 1474 | | |
1477 | 1475 | | |
1478 | | - | |
1479 | 1476 | | |
1480 | 1477 | | |
1481 | 1478 | | |
| |||
1518 | 1515 | | |
1519 | 1516 | | |
1520 | 1517 | | |
1521 | | - | |
1522 | 1518 | | |
1523 | 1519 | | |
1524 | 1520 | | |
| |||
1555 | 1551 | | |
1556 | 1552 | | |
1557 | 1553 | | |
1558 | | - | |
1559 | 1554 | | |
1560 | 1555 | | |
1561 | 1556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
148 | 164 | | |
149 | 165 | | |
150 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
0 commit comments