Repository navigation
Don't follow symlinks when updating permissions recursively - #574
Merged
xylar merged 1 commit intoNov 23, 2026
Merged
Conversation
update_permissions() used os.stat(), os.chown() and os.chmod(), which follow symlinks, on every path found while traversing a directory. A symlink to somewhere else had its target's group and mode changed instead. On Riker, the E3SM-Unified 1.14.0 release updated e3smu_latest_for_nco, a group-writable directory of links to deployed pixi environments, with owner_writable=True. That made the read-only environments it links to (e3smu_1_14_0/frontier/pixi_login and e3smu_1_14_0/riker/pixi) owner-writable again. Skip symlinks found while traversing, as restore_owner_write() already does. A symlink given as one of the base paths is still followed, since the caller asked for that path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
update_permissions()followed symlinks it found while traversing a directory, so it changed the group and mode of whatever they pointed to. On Riker, the E3SM-Unified 1.14.0 release updatede3smu_latest_for_nco, a directory of links to deployed environments, and made the read-only Frontier and Riker environments it links to owner-writable again. This merge skips symlinks found while traversing, asrestore_owner_write()already does. A symlink passed directly as a base path is still followed.Checklist
Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.
🤖 Generated with Claude Code