Repository navigation
fix(disk-hygiene): trust the no-interpreter notice marker only in an owned directory - #7187
Conversation
…owned directory The tmp fallback marker directory sits where every local user can write, so another user could create it first, or a symlink in its place, and silence the once-per-session no-Python notice. The launcher now reads and writes a marker only in a real directory this user owns. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8KdG7fWg2YrErVYWtohmR
|
The lanes run once the PR is marked ready. That flip waits for Kyle, because it also starts the review lanes. Until then, the local runs listed under Verification in the PR body are the signal. Generated by Claude Code |
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. |
|
Claude finished @kyle-sexton's task in 3m 49s —— View job Security review: no issues found
Scope: Analysis: The new
No path lets another local user silence the notice or redirect the write to attacker-chosen content. Quoting throughout is correct ( The one related gap — the No CRITICAL, IMPORTANT, or SUGGESTION findings. claude-lane-summary: lane=claude-security-review sha=9aaef9088499a1d765156108a50dc82fdbda9b70 run=38402283697 |
|
Claude finished @kyle-sexton's task in 3m 19s —— View job Code review
Findings: 0. Traced Noted but out of scope for this lane: Verification note: I could not execute claude-lane-summary: lane=claude-review sha=9aaef9088499a1d765156108a50dc82fdbda9b70 run=38402284162 |
|
claude-review has reviewed this pull request through 9aaef90; a later push is reviewed from there. |
|
claude-security-review has reviewed this pull request through 9aaef90; a later push is reviewed from there. |
Requested by Kyle · project thread
Closes #6350
Summary
Before: with no Python, disk-hygiene showed its no-interpreter notice once per session, latched by a marker it trusted wherever it found one. When
--marker-rootwas absent or unwritable, the marker lived in${TMPDIR:-/tmp}/disk-hygiene-guard-no-interpreter/. Another local user could create that directory first, or a symlink in its place, with a marker for any session, and so silence the notice for everyone. The guard's denies were never affected.After:
run-python-hook.shreads or writes the notice marker only in a real directory this user owns ([[ -d && ! -L && -O ]], all builtins). A directory that fails the test is skipped, so the notice shows again (over-reporting, the safe direction this notice already takes).Fix
plugins/disk-hygiene/hooks/run-python-hook.sh: new_owned_marker_dir, used by_no_python_noticedbefore it trusts an existing marker and before it writes one. It does not create through an existing symlink or a foreign directory.plugins/disk-hygiene/hooks/run-python-hook.test.sh: a symlinked marker directory holding this session's marker still notices, nothing is written through the symlink, and the notice never latches. A directory owned bynobodystill notices; that case needs root to set up and printsSKIPotherwise. A stay-quiet case shows that this user's own tmp directory still latches the notice once per session.disk-hygiene(patch, Security).Defaults I picked where the issue left a detail open:
-Orelies on MSYS's owner mapping. If a directory reads as not owned, the notice repeats rather than going silent.Verification
bash plugins/disk-hygiene/hooks/run-python-hook.test.sh: pass, including the new cases. The foreign-owner case ran as root here.run-python-hook.shfails on the new symlink case:FAIL: a symlinked marker directory holding this session's marker is not trusted.shellcheckon both files: clean.shfmtis not installed here, so formatting was not machine-checked.scripts/check-changelog-fragments.sh --checkand--check-required origin/main,scripts/check-changelog-parity.sh --check: pass. markdownlint on the fragment: 0 issues.scripts/affected-tests.sh --base origin/main --runwas stopped early when the overnight run wrapped up. 26 of the 142 selected suites had finished, all passing, including every disk-hygiene suite. The rest were not run.Related
.launchedskip marker (--launch-marker/--skip-unless-marker) uses the same tmp fallback shape. A directory planted there could make theStopmonitor skip. Worth a follow-up with the same check.run-python-hook.test.shandhooks.jsonin disk-hygiene.git merge-treeagainst its branch refused with "unrelated histories", so the overlap is unchecked.🤖 Generated with Claude Code
https://claude.ai/code/session_01L8KdG7fWg2YrErVYWtohmR
Generated by Claude Code