Skip to content

tar: resolve symlink resilience and path normalization issues#323

Open
kaladron wants to merge 1 commit into
uutils:mainfrom
kaladron:symlink
Open

tar: resolve symlink resilience and path normalization issues#323
kaladron wants to merge 1 commit into
uutils:mainfrom
kaladron:symlink

Conversation

@kaladron

Copy link
Copy Markdown
Collaborator
  • Use symlink_metadata instead of exists/is_dir in create_archive, get_tree, and print_verbose_tree to avoid incorrectly following symlinks.
  • Disable following symlinks in tar Builder by default.
  • Implement clean_path to fix path normalization for paths containing parent directory components (..).
  • Add integration tests for symlinks, nested symlinks, and path normalization.

@kaladron kaladron marked this pull request as draft July 11, 2026 10:10
@codspeed-hq

codspeed-hq Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing kaladron:symlink (9dfa1f7) with main (d1e56e3)

Open in CodSpeed

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.79412% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.93%. Comparing base (791ae26) to head (9dfa1f7).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
tests/by-util/test_tar.rs 97.60% 4 Missing ⚠️
src/uu/tar/src/operations/create.rs 97.87% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
+ Coverage   96.84%   97.93%   +1.08%     
==========================================
  Files          11       15       +4     
  Lines        1492     1982     +490     
  Branches       29       42      +13     
==========================================
+ Hits         1445     1941     +496     
+ Misses         46       40       -6     
  Partials        1        1              
Flag Coverage Δ
macos_latest 97.93% <97.79%> (+1.08%) ⬆️
ubuntu_latest 97.93% <97.79%> (+1.08%) ⬆️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kaladron kaladron force-pushed the symlink branch 6 times, most recently from 628947a to a34fc9e Compare July 11, 2026 11:17
- Use symlink_metadata instead of exists/is_dir in create_archive,
  get_tree, and print_verbose_tree to avoid incorrectly following symlinks.
- Disable following symlinks in tar Builder by default.
- Implement clean_path to fix path normalization for paths containing
  parent directory components (..).
- Add integration tests for symlinks, nested symlinks, and path normalization.
@kaladron kaladron marked this pull request as ready for review July 11, 2026 11:44
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.

1 participant