Repository navigation
fix(install): browser extension setup fails under Ubuntu's default umask 0002 - #186782
Conversation
Under the user-private-group default umask 0002 (Ubuntu, Fedora), npm install -g wrote the OpenClaw package group-writable, and owned-path checks refused it: the browser extension setup failed with "Refusing group/world-writable path". openclaw#179538 scoped umask 077 around directory creation only; npm-created files still inherited the caller's umask. Both installers now drop group and world write from their umask at startup, covering every file they create.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesBoth Bash installers prevent newly created package files and directories from being group- or world-writable. Example: A non-root Linux user installs OpenClaw under umask 0002.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR fixes a current installer permission bug with a focused producer-side change; no actionable code defects were found. Priority: P0 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe standalone installers provision Node and the OpenClaw package; browser extension setup subsequently validates ownership and permissions of the bundled extension. flowchart LR
A[Desktop setup or shell] --> B[Bash installer]
B --> C[Restrict file creation mask]
C --> D[npm package installation]
D --> E[Browser ownership check]
E --> F[Extension setup]
Technical reviewBest possible solution: Ship safe package creation through the existing setup installer so users can retry installation without manual permission edits. Do we have a high-confidence way to reproduce the issue? Current source connects npm's inherited 0002 mask to package modes rejected by browser extension inspection; no target code was executed during this read-only review. Is this the best way to solve the issue? The smallest complete fix is to tighten creation permissions in both installer processes, preserve stricter inherited restrictions, and retain the browser's existing ownership policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2270152d224a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +11, Other +8. Total +19 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 4, 2026, 11:55 PM ET / November 5, 2026, 04:55 UTC (Revision 3). |
|
Added the existing-install upgrade run (2026.10.7 → 2026.10.8 under umask 0002, settings and data preserved) to the Evidence section. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…86782) Installer-driven npm installs inherited group-write permissions under umask 0002, causing browser extension setup to reject its own installed package. Remove group/world write bits in both standalone installer processes while preserving stricter masks and the invoking shell. Related: #179493, #179538. Validation: contributor regression red on base, 290 installer tests passed with two platform skips; prior non-root npm/browser inspection and upgrade proof retained. Independent static checks and full-diff review passed; exact-head CI 40698308949 passed. Latest-stable upgrade was not repeated. Co-authored-by: Javier MV <[email protected]> Backport-source: eb5d0cb Backport-scope: Set umask go-w at both installer starts; preserve stricter inherited mask; do not chmod existing installations. Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately. Co-authored-by: RomneyDa <[email protected]>
…enclaw#186782) Installer-driven npm installs inherited group-write permissions under umask 0002, causing browser extension setup to reject its own installed package. Remove group/world write bits in both standalone installer processes while preserving stricter masks and the invoking shell. Related: openclaw#179493, openclaw#179538. Validation: contributor regression red on base, 290 installer tests passed with two platform skips; prior non-root npm/browser inspection and upgrade proof retained. Independent static checks and full-diff review passed; exact-head CI 40698308949 passed. Latest-stable upgrade was not repeated. Co-authored-by: Javier MV <[email protected]>
Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: eb5d0cb — Javier MV — fix(install): keep the installed runtime private under umask 0002 (#186782) Backport-of: b079019 — Sukhdeep — fix(daemon): Gateway repair stops the Gateway and fails when macOS denies the Trash (#189321) Backport-of: 558e2f3 — YangManBOBO — fix(cli): compare gateway state dirs case-insensitively on Windows (#185917) Backport-of: b7ce1c3 — Peter Steinberger — test(windows): keep ordinary CLI coverage in one partition Backport-of: ba75cf7 — Juan Buhagiar Duijst — fix(diagnostics-otel): gateway stalls after model calls on large sessions with content capture on (#186666) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]>
* fix(gateway): publish node reapproval with committed pairing facts Adapt main commit 94f180d to the extended-stable worker dispatcher, retaining cleanup admission and stale-session fencing. Co-authored-by: RomneyDa <[email protected]> * test(gateway): clarify CLI announcement tool-only phase Keep exact token, barrier, and completion ordering assertions intact while explicitly excluding narration before the barrier. Co-authored-by: RomneyDa <[email protected]> * style(gateway): format node reapproval regression Reflow the spy chain reported by hosted CI; no behavioral changes. Co-authored-by: RomneyDa <[email protected]> * test(secrets): decouple Telegram fixture from plugin discovery Import the real public Telegram secret collector directly so collection does not depend on Gateway discovery environment. Exercise collection with bundled plugins disabled while retaining existing token assertions. Gateway timeout attribution remains unresolved; no production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test(secrets): load Telegram fixture through public resolver Replace the static extension import rejected by core type and boundary checks with the existing test public-artifact resolver. Keep the real collector in the Vitest module graph and preserve the disabled-discovery regression. Independent source review accepted; local test, typecheck, build, install, and performance execution remain excluded by operator instruction. Hosted CI must validate the correction. Co-authored-by: RomneyDa <[email protected]> * style(secrets): format Telegram fixture import Co-authored-by: RomneyDa <[email protected]> * fix(ui): honor recovery holds before initial chat history Keep drafting available while the existing send owner holds recovery or a retained initial turn. Restore Send when that hold clears without waiting for initial history or submitting the draft automatically. Add renderer regressions for both holds and clarify the pre-history outbox contract. Controlled real-Gateway red/green evidence: 42523861169 / 42526889715. Diagnostic branch is not merged. Co-authored-by: RomneyDa <[email protected]> * fix(ui): preserve startup status presentation while holding send Restore the existing connected startup/history status suppression without reopening Send admission. Extend both durable hold regressions to reject the duplicate composer status band. Existing cloud E2E assertions remain unchanged. Co-authored-by: RomneyDa <[email protected]> * fix(release): backport installer, service, path and telemetry repairs Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: eb5d0cb — Javier MV — fix(install): keep the installed runtime private under umask 0002 (#186782) Backport-of: b079019 — Sukhdeep — fix(daemon): Gateway repair stops the Gateway and fails when macOS denies the Trash (#189321) Backport-of: 558e2f3 — YangManBOBO — fix(cli): compare gateway state dirs case-insensitively on Windows (#185917) Backport-of: b7ce1c3 — Peter Steinberger — test(windows): keep ordinary CLI coverage in one partition Backport-of: ba75cf7 — Juan Buhagiar Duijst — fix(diagnostics-otel): gateway stalls after model calls on large sessions with content capture on (#186666) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): preserve notes and harden messaging and exec approval Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: 0a171b4 — Leizhen Zhang — fix(auto-reply): long punctuation runs stall abort-trigger detection (#184433) Backport-of: 49600b5 — Long Jin — fix(memory): preserve inline notes during MEMORY.md compaction (#164089) Backport-of: 982f3b1 — RoboClaw — fix(imessage): report Automation failures after Gateway updates (#186117) Backport-of: 3f7ee38 — art22s — fix: require approval for dynamic shell predicates (#187884) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): retain sandbox, recovery lease and Matrix boundaries Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: a19f1bf — Agustin Rivera — fix(agents): fail closed when sandboxed spawned children resolve CLI-backed models (#178742) Backport-of: c9f3f82 — Peter Steinberger — fix(agents): release restart-recovery fences for killed runs (#181992) Backport-of: dfb6454 — Leizhen Zhang — fix(matrix): crafted formatted_body stalls the Gateway in the mention check (#184432) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(config): preserve last-good state through writes and rollback Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: 99418fc — weiqinl — fix(config): keep last-known-good when the observer flags the config as truncated (#152565) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(sessions): preserve history when relocating relative stores Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: a64daf7 — Peter Steinberger — fix(sessions): resolve relative session stores against the state dir, not the working directory (#182444) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): repair September backport type contracts Split terminal recovery actions into distinct discriminants without changing behavior. Use the branch-native Doctor import signature, checking held maintenance authority before and after the awaited import. Validation: independent exact-diff source review, formatter and git diff --check passed. Local tests, typechecks and builds not run per operator restriction; fresh exact-head remote qualification required. Repairs CI 42643973970 attempt 1. Co-authored-by: RomneyDa <[email protected]> * fix(release): align backport regressions with September contracts Preserve uncertain config-write outcomes while correcting branch-native fixture APIs and lint errors found by hosted CI. Co-authored-by: RomneyDa <[email protected]> * test(ci): separate Windows capacity from growing inventory Keep package coverage and the five-job limit independent of a historical timing snapshot. Preserve the rounded capacity boundary and exercise the documented bounded-growth fallback with fixed estimates. Co-authored-by: RomneyDa <[email protected]> * test(node-host): keep launcher cleanup with its invoke owner Wait for a positive launcher PID before probing liveness, and cancel through the existing invocation owner on every exit path. Never send SIGKILL to file-derived PID zero. Co-authored-by: RomneyDa <[email protected]> * test(release): observe owned Gateway reservation cleanup Verify the real reservation closes before relaunch instead of rebinding an already-released port that another socket can acquire. Preserve all seven packaged startup recovery scenarios. Co-authored-by: RomneyDa <[email protected]> * test(release): capture native compiler busy-executable evidence Preserve real API execution and errors while recording failure-only executable inode and writable descriptor metadata. Add a Linux kernel-path diagnostic regression; no retry or copy change. Co-authored-by: RomneyDa <[email protected]> * test(release): repair stability regression fixtures Register CLI admission metadata through the runtime registry, observe the rollback health baseline, and preserve exact SQLite byte expectations. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Backport #186782: remove group and other write access from both installer process umasks without weakening stricter caller masks or changing the Bash re-exec guards. Reuse the real npm installation flow with external command fixtures to verify created package modes under 0002 and 0077. Existing files and the invoking shell are unchanged. Baseline: both 0002 cases created 0775 paths instead of 0755; 0077 remained 0700. Fixed: four regression cases and 450 tests across installer and Bash guard siblings passed, five platform skips. Bun sibling fixture was blocked before product execution because /usr/bin/zip is absent. Typecheck, lint, format, Bash syntax, docs MDX and test-line ratchet passed. Independent review finding resolved by removing an allocation for a helper filename outside ratchet scope; physical helper growth is 19 lines. (cherry picked from commit eb5d0cb) Co-authored-by: Javier MV <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit 29d24df6707c971a567db197f3978c2c1c4e9b54)
Related: #179493, #179538
What Problem This Solves
Fixes: browser extension setup refuses the installed package after installation under a default umask of 0002, as on Ubuntu and Fedora.
User Impact
User impact: fresh installs and installer-driven upgrades produce package paths that pass the existing ownership check, with settings and workspace data preserved. The invoking shell's umask is unchanged.
Why This Change Was Made
The earlier private-directory repair covered mkdir calls, but npm still inherited the caller's mask and created group-writable package contents. Both standalone installers now remove group/world write permission from their process-local mask. Stricter inherited permissions stay strict; the browser's owned-path check remains intact.
Thanks to @javiermv for the fix and reproduction. The diff-scoped simplification pass retained the two small installer blocks: sharing them would compromise the standalone installer contract. Production +8 lines (two executable lines plus comments/spacing); tests +11 net.
Evidence
openclaw browser extension setup --action inspect --json --wait-ms 1000. Base refuses the group-writable extension; head reportsnextAction: install.install-cli.shremoves unsafe package modes while preserving gateway.port, config and workspace hashes.Live install/upgrade was not rerun in this lane; the contributor's existing isolated runs above are retained as prior proof. The
install.shpath has shared regression coverage; the real upgrade run exercisedinstall-cli.sh.The retained upgrade predates stable 2026.10.10; an upgrade from that latest stable version was not rerun. The patch is unchanged, and the original non-root installation/upgrade output below exercises the same package-permission boundary.
Contributor's original proof record
Evidence
test/scripts/install-test-contract.ts, run by bothinstall-cli.test.tsandinstall-sh.test.ts: install under a 0002 caller umask, then assert that no package path is group- or world-writable. It fails onorigin/main(4 group-writable paths in each installer) and passes with the fix.vitest run test/scripts/install-cli.test.ts test/scripts/install-sh.test.ts: 290 passed, 2 skipped (Darwin-only re-exec tests).node:24.22.1container as a non-root user withumask 002, usinginstall-cli.sh --prefix <tmp> --runtime-only --no-onboard(installs OpenClaw 2026.10.8), thenopenclaw browser extension setup --action inspect --json --wait-ms 1000:origin/mainbrowser extension setup --action inspectRefusing group/world-writable path at …/openclaw/dist/extensions/browser/chrome-extension"nextAction": "install"umask 0002and a throwawayHOME(default prefix and state dir~/.openclaw): install 2026.10.7 withorigin/main'sinstall-cli.sh --version 2026.10.7 --runtime-only --no-onboard, setgateway.port 18790and write~/.openclaw/workspace/NOTES.md, then upgrade to latest (2026.10.8) withinstall-cli.sh --runtime-only --no-onboardfrom each side. Writable counts exclude symlinks, whose mode is always 0777 and unused on Linux.origin/mainopenclaw --versionconfig get gateway.portopenclaw.json,workspace/NOTES.md(sha256)browser extension setup --action inspectRefusing group/world-writable path at ~/.openclaw/tools/node-v24.22.1/lib/node_modules/openclaw/dist/extensions/browser/chrome-extension"nextAction": "install"Upgrade run output (this PR)
Originally found with the 2026.10.6
.debon Ubuntu 24.04, which bundlesinstall-cli.sh.Not in scope: repairing existing installs without reinstalling (for example from
openclaw doctor --fix). The upgrade run coversinstall-cli.sh;install.shshares the same one-line change and contract test.