Repository navigation
fix(install): accept user-private-group 0775 for canonical link parents - #2873
Conversation
…arents Fresh installs on Debian/Ubuntu boxes with user-private groups (umask 002) failed at the promote preflight: ~/.local/bin is created 0775 <user>:<user> there, and assertSafeOwnedDirectoryStat rejected any group-write bit. New classifyOwnedDirectorySafety allows group-write only when the directory's gid equals the process's effective gid — as private as 0755 — while world-write, foreign-group write, and foreign ownership stay rejected, each with an actionable message (chmod/chown remedy) instead of the generic "safe permissions". The install-promote command now prints those preflight errors cleanly and exits 1 instead of escaping as a raw Bun stack trace. Reported from a fresh linux box, 2026-08-31; reproduced with a 0775 fixture (mode & 0o022 = 16 despite uid and egid matching). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gGxGgKskzyzr1HRUB6cV3
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e2f5a94d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ((mode & 0o002) !== 0) { | ||
| return { ok: false, reason: `is world-writable (mode ${octal})`, remedy: 'run: chmod o-w <path>, then retry' }; | ||
| } | ||
| if ((mode & 0o020) !== 0 && stat.gid !== identity.gid) { |
There was a problem hiding this comment.
Prove the effective group is private before accepting 0775
On systems where the user's effective group is shared, a 0775 parent has stat.gid === identity.gid even though other group members can rename or replace ~/.local/bin/genie. This condition therefore removes the previous protection and permits a local group member to substitute the executable reached through the user's PATH; matching the effective GID proves membership, not that this is a user-private group, so the relaxation must verify exclusivity or continue rejecting group-write permission.
Useful? React with 👍 / 👎.
Fresh-install blocker reported 2026-08-31:
curl … install.sh | bashon a stock Debian/Ubuntu box (user-private groups, umask 002) dies withCanonicalInstallLinkError: ~/.local/bin is not current-user-owned with safe permissionsplus a raw Bun stack —~/.local/binis0775 <user>:<user>there andassertSafeOwnedDirectoryStatrejected any group-write bit.classifyOwnedDirectorySafety: group-write allowed only when the dir's gid == process egid (user-private-group layout, as private as 0755); world-write, foreign-group write, wrong owner, nlink<1 stay rejected — each with an actionable remedy (chmod g-w/chmod o-w/chown) naming the actual mode/uid/gid.genie install-promoteprintsCanonicalInstallLinkError/InstallPromoteCommandErrorcleanly and exits 1 — no stack trace to the operator.~/.local(+bin)preflight integration accept; existing world-writable-ancestor rejections re-asserted on the new wording.mode & 0o022 = 16on a 0775 dir with uid and egid matching.Gates: install-link + install-promote suites 27/27, typecheck, lint (3 pre-existing warnings), knip, complexity budget.
Workaround for affected boxes until this ships:
chmod g-w ~/.local ~/.local/binand re-run the installer.🤖 Generated with Claude Code
https://claude.ai/code/session_013gGxGgKskzyzr1HRUB6cV3