Skip to content

build: avoid chmod through path symlinks#2229

Open
officialasishkumar wants to merge 1 commit into
chainguard-dev:mainfrom
officialasishkumar:path-symlink-permissions
Open

build: avoid chmod through path symlinks#2229
officialasishkumar wants to merge 1 commit into
chainguard-dev:mainfrom
officialasishkumar:path-symlink-permissions

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

  • skip the automatic chmod/chown pass after paths symlink mutations
  • skip symlink entries during recursive directory permission walks
  • add tests for symlinks to missing targets, preserving target directory permissions, and recursive walks over broken symlinks

Fixes #1270.
Fixes #1565.

Validation

  • go test ./pkg/build -run 'TestMutatePathsSymlinkAllowsMissingTarget|TestMutatePathsSymlinkDoesNotChangeTargetPermissions|TestMutateDirectoryRecursiveSkipsSymlinks' -count=1\n- git diff --check\n\nNote: I also attempted go test ./pkg/build -count=1, but the process stalled in the Go link step on this shared machine and was terminated to avoid leaving it running.\n

@officialasishkumar officialasishkumar force-pushed the path-symlink-permissions branch from 036eaa4 to 30d0cb1 Compare May 12, 2026 05:11
@github-actions github-actions Bot force-pushed the path-symlink-permissions branch from 30d0cb1 to 1758bc6 Compare May 12, 2026 05:16
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.

apko paths fails to create a folder with a symlink can't create symlink to a file that does not exist

1 participant