Skip to content

fix: refuse rewriting through symbolic links - #3

Closed
hc-ui wants to merge 7 commits into
mainfrom
cursor/refuse-symlink-writes-aa74
Closed

hc-ui wants to merge 7 commits into
mainfrom
cursor/refuse-symlink-writes-aa74

Conversation

@hc-ui

@hc-ui hc-ui commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Directory walks still skip file symlinks (so a stray link cannot pull an outside path into a repo-wide scan/fix). Explicitly named file symlinks are now analyzed, but fix --apply and attributes --write refuse to write through a symlink (no replacing the link, no appending to the link target).

This is a different gap from #1 (default-explain / check unreadable / GitContext cwd) and #2 (PowerShell CRLF).

Changes

  • collect_files no longer silently skips a named file symlink.
  • apply_action and attributes --write error instead of following the link.
  • Tests cover named-link analysis, refused fix --apply, and refused .gitattributes write.
  • No version bump.

Tests

PYTHONPATH=. python3 -m pytest -q → 155 passed.

@hc-ui
hc-ui marked this pull request as ready for review August 26, 2026 10:30
@hc-ui

hc-ui commented Aug 26, 2026

Copy link
Copy Markdown
Owner Author

同一份修改已经基于当前 main(含 #1/#2)重新开出并合并:#4

这个 PR 和已合并的 #1/#2 冲突,所以改关掉,不是修改丢了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant