Thin archives: fix BSD long filenames and directory entries #196
Labels
No labels
agent/review
priority/high
priority/low
priority/medium
status/blocked
status/wontfix
time/marathon
time/quickwin
type/bug
type/cicd
type/docs
type/feature
type/security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
thwap/manta-archiver#196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thin archive creation currently fails when filenames contain slashes (BSD long filename format) or for directory entries. The writer's padding logic and reader's handling need adjustment for these cases.
Symptoms:
reptar -t -f archive.thinreturns "unexpected EOF".Need to investigate:
Unit tests pass for simple cases (short filenames, regular files, symlinks).
Fixed in commit [TBD]. The root cause was:
Padding logic: The writer's
padToEvenwas incorrectly skipping padding for thin archives when the total entry size (including BSD long filename data) was odd. Fixed by always padding based ontotalSize(which includes BSD long filename length).Reader handling: The reader's
Next()method wasn't properly handling padding after BSD long filenames in thin archives. Added explicit skip of leftover data and padding.Metadata skip: The
SkipInternalMetaglobal flag wasn't being respected inensureMetaDir()andaddMetaEntry(), causing metadata directory entries to be written even when--no-internal-metawas set.All AR package tests now pass, including new tests
TestThinArchiveBSDLongFilenameandTestThinArchiveDirectory.Thin archives with BSD long filenames and directory entries now work correctly.