Skip to content

test(metadata): pin --keep-dirlinks cross-platform chmod bypass safety - #5803

Merged
oferchen merged 2 commits into
masterfrom
test/kdl-7-1-keep-dirlinks-cross-platform-parity
Jun 15, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/kdl-7-1-keep-dirlinks-cross-platform-parity

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds keep_dirlinks_bypass_is_cross_platform_safe in crates/metadata/src/apply/tests.rs alongside the existing keep_dirlinks_bypasses_secure_chmod_sandbox (macOS-only) test, pinning the guarantee that apply_file_metadata_with_options succeeds through a symlinked destination directory under --keep-dirlinks on Linux, macOS, and Windows.
  • Codifies the KDL.7 audit conclusion: Linux is clean by construction (openat2(RESOLVE_BENEATH) sandboxes parent components only, leaf symlink is legal under --keep-dirlinks) and Windows chmod is a no-op (FILE_ATTRIBUTE_READONLY); any future refactor that breaks the bypass surfaces here.

Test plan

  • nextest (Linux) green for metadata::apply::tests::keep_dirlinks_bypass_is_cross_platform_safe
  • nextest (macOS) green for the same test
  • nextest (Windows) green for the same test

Add a cross-platform regression test asserting that
apply_file_metadata_with_options succeeds through a symlinked destination
directory under --keep-dirlinks on Linux, macOS, and Windows. Pins the
guarantee from PR #5793 (macOS chmod bypass) and PRs #5798/#5799
(extension to four more chmod sites), and codifies that Linux
(openat2 RESOLVE_BENEATH sandboxes parents only) and Windows (chmod
no-op) are clean by construction.
@github-actions github-actions Bot added the test label Jun 15, 2026
@oferchen
oferchen merged commit 16ea1cd into master Jun 15, 2026
65 of 67 checks passed
@oferchen
oferchen deleted the test/kdl-7-1-keep-dirlinks-cross-platform-parity branch June 15, 2026 10:42
oferchen added a commit that referenced this pull request Aug 24, 2026
#5803)

Add a cross-platform regression test asserting that
apply_file_metadata_with_options succeeds through a symlinked destination
directory under --keep-dirlinks on Linux, macOS, and Windows. Pins the
guarantee from PR #5793 (macOS chmod bypass) and PRs #5798/#5799
(extension to four more chmod sites), and codifies that Linux
(openat2 RESOLVE_BENEATH sandboxes parents only) and Windows (chmod
no-op) are clean by construction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant