fix(disk-hygiene): do not re-close fd in _discard_stream null_fd repair - #2254
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 2m 26s —— View job Security Review
Reviewed the diff against No exploitable security vulnerability found. The core fix is correct: guarding One low-severity, non-exploitable logic note found via data-flow reasoning (not something static analysis would catch): [SUGGESTION / low confidence-of-impact, high confidence-in-mechanism] Possible null_fd = os.open(os.devnull, os.O_WRONLY)
try:
target_fd = stream.fileno()
os.dup2(null_fd, target_fd)
finally:
if null_fd != target_fd:
os.close(null_fd)The function's own docstring calls out that I don't believe this reopens #1526: both call sites ( No issues found with |
|
Claude finished @kyle-sexton's task in 3m 22s —— View job Code review complete
This repo has a SummaryThe core fix is correct and well-targeted: One correctness regression (posted as an inline comment on I verified the |
|
Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
…2255) ## Summary Mirror the #2016 `disk-hygiene` confirmation-gate prose fix in `repo-hygiene`: the inline-question fallback must trigger when `AskUserQuestion` is absent, denied, or otherwise unusable — not only when it is absent. ## Fix - Update `plugins/repo-hygiene/skills/clean/SKILL.md` confirmation gate question-surface rule to match the corrected `dontAsk` / deny / disallowed-tools wording. - Bump plugin to 0.10.1 with CHANGELOG entry. ## Verification Prose-only change; no shell/python suites map to this file. Reviewed against the live permissions docs claim cited in #2088 and the merged `disk-hygiene` sibling wording. ## Related Fixes #2088 (completes the three-item sweep alongside #2252 and #2254). Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
|
Warning Automated review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
Re-run the job to retry the review. A new push re-triggers this lane only if the caller's |
|
Warning Automated security review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
The check is green on purpose, and it is not evidence. It certifies that a security pass ran, and this one did not complete — but the cause is outside this PR's control, so merging is deliberately left unblocked rather than locking every merge for the length of the outage. Nothing was reviewed at this head. Where this check is required, it is satisfied without that evidence; a human should review security-sensitive changes here before merging. Re-run the job to retry the review; a new push also retries it only if the caller's Re-running does NOT help for every class:
|
Relates #2088 Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
…stream Move target_fd = stream.fileno() before os.open so a fileno() failure cannot leave an opened null device fd whose finally block never runs os.close. Add a regression test that fileno() raising does not call os.open. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
6ed2098 to
57a174f
Compare
No linked issue
Summary
Fix
_discard_streamso it does not closenull_fdwhen that fd number is the stream being repaired — the #1526 self-undo when fd 2 was closed outright.Fix
os.close(null_fd)withif null_fd != target_fdafterdup2.GuardTests.test_discard_stream_keeps_closed_stderr_fd_openthat closes fd 2 and verifies_discard_streamleaves it open.Verification
cd plugins/disk-hygiene/skills/clean/scripts python3 -m unittest test_hygiene.GuardTests.test_discard_stream_keeps_closed_stderr_fd_open \ test_hygiene.GuardTests.test_stderr_fd_closed_outright_still_denies_at_exit_2_in_a_real_process -vBoth tests pass.
Related
Refs #2088
Refs #1526