Skip to content

Don't follow symlinks when updating permissions recursively - #574

Merged
xylar merged 1 commit into
E3SM-Project:mainfrom
xylar:dont-follow-symlinks-in-permissions
Nov 23, 2026
Merged

xylar merged 1 commit into
E3SM-Project:mainfrom
xylar:dont-follow-symlinks-in-permissions

Conversation

@xylar

@xylar xylar commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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 updated e3smu_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, as restore_owner_write() already does. A symlink passed directly as a base path is still followed.

Checklist

  • Tests pass and new features are covered by tests
  • PR description includes a summary and any relevant issue references

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

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>
@xylar
xylar merged commit de09715 into E3SM-Project:main Nov 23, 2026
9 checks passed
@xylar xylar added the bug Something isn't working label Nov 23, 2026
@xylar
xylar deleted the dont-follow-symlinks-in-permissions branch November 23, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant