Repository navigation
import/export-tar: --tar-format=PAX (1.4-maint) - #10500
Open
ThomasWaldmann wants to merge 4 commits into
Open
ThomasWaldmann wants to merge 4 commits into
ThomasWaldmann wants to merge 4 commits into
Conversation
export-tar --tar-format=PAX|GNU (default: GNU, as before). With PAX, export-tar additionally transfers atime, ctime and mtime with nanosecond resolution, xattrs and POSIX ACLs, using the same PAX header keys as star and GNU tar (SCHILY.xattr.*, SCHILY.acl.access/default). Timestamps are written as exact decimal strings, not via float, so nanosecond timestamps roundtrip exactly. import-tar reads these PAX headers from any tarball. ACL texts are converted to borg's format: GNU tar does not append the numeric uid/gid to named entries, which made borg extract crash in acl_use_local_uid_gid. system.posix_acl_* xattrs (GNU tar --xattrs-include='*') are skipped, like borg create does, because ACLs are stored separately. Backport of the PAX parts of master's --tar-format (78e92fa), xattr (e0fdaa4) and POSIX ACL (fe5a991) support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.4-maint #10500 +/- ##
=============================================
+ Coverage 82.10% 82.26% +0.16%
=============================================
Files 38 38
Lines 11480 11550 +70
Branches 1808 1828 +20
=============================================
+ Hits 9426 9502 +76
+ Misses 1468 1465 -3
+ Partials 586 583 -3 ☔ View full report in Codecov by Harness. |
- test_tar_acl_to_borg: use uid2user(0) instead of assuming "root" (it is "user" on Haiku), like test_get_item_uid_gid does. - test_export_tar_pax_headers: compare against the timestamps the filesystem actually stored (BFS has a coarser resolution). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like on master (borgbackup#10499): - test_export_tar_pax_headers: compare the imported item timestamps with exact ns precision, not via borg list (only us precision). - test_import_tar_invalid_pax_timestamp: invalid PAX timestamps get ignored, valid ones are used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- item_to_paxheaders: module-level function, structured like master's (without the BORG format parts). - help texts: same --tar-format table and import-tar text as master (without the BORG format). - tests: same names and structure as master's tests for the same functionality (test_roundtrip_pax_timestamps, test_acl_roundtrip, test_tar_acl_to_borg, ...). The 1.4 specific differences are kept: GNU stays the default and empty xattr values are None (like xattr.get_all in 1.4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Description
Backports the PAX part of
--tar-formatto 1.4-maint, refs #7146.borg export-tar --tar-format=PAX|GNU, the default staysGNU(no behaviour change for existing users).With
PAX, export-tar additionally transfers:SCHILY.xattr.*)SCHILY.acl.access,SCHILY.acl.default)These are the same PAX header keys star and GNU tar use. Timestamps are written as exact decimal strings (not via
float, which only gives ~240 ns precision at today's epoch), so nanosecond timestamps roundtrip exactly.borg import-tarreads these PAX headers from any tarball:user:nobody:rw-), which madeborg extractcrash inacl_use_local_uid_gid(IndexError). The id is looked up locally, likeborg createdoes.system.posix_acl_*xattrs (stored bytar --xattrs-include='*') are skipped, likeborg createdoes, because ACLs are stored separately.None, matching 1.4'sxattr.get_allconvention.The
BORGtar format from master is intentionally not backported: it serializes borg 1.x-internal item metadata (incompatible with borg2's), and in 1.4 trusting item metadata from a tarball (e.g. chunk lists) would be dangerous because of chunk refcounting.Based on master's 78e92fa (
--tar-format), e0fdaa4 (xattrs) and fe5a991 (POSIX ACLs).Testing
--format=posix --xattrs --acls→ borg import-tar → extract): xattrs, access + default ACLs and exact ns mtime preserved.Checklist
1.4-maint🤖 Generated with Claude Code