Conversation
The previous logic allowed symlinks to overwrite original files when processing was run multiple times. This new logic should prevent that.
The previous fix (dc3decf) added os.path.islink(src) to skip symlinks on the source side, but did not prevent the case where the destination directory itself resolves to the source directory (e.g., when OCX_main is a symlink to OCX, or when OCX_main/atmosphere is a symlink to OCX/atmosphere). This change adds two realpath-based guards: 1. Directory-level: Skip the entire mirror operation if the destination directory resolves to the source directory. 2. File-level: Skip individual files if the destination file would resolve to the source file. Both guards use os.path.realpath() which fully resolves symlink chains, so the original atmosphere files can never be overwritten by the mirroring logic, regardless of directory aliasing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
trhille
force-pushed
the
landice/fix_circular_symlinks
branch
from
September 24, 2026 19:29
6c76828 to
a2b2965
Compare
Collaborator
Author
|
Closing this in favor of #997, which contains these changes in the refactored code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous logic allowed symlinks to overwrite original files when processing was run multiple times. This new logic should prevent that.
Checklist
Testingin this PR) any testing that was used to verify the changes