-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAX Extract file fix Pull#2 #19
base: master
Are you sure you want to change the base?
Conversation
fixing directory size to match zero on TAR archives FileInfo
FileInfo code display fix
When adding a file which size is being changed during archiving, the archive would become corrupt because the size in the header is different than the size of the actual data written. So an additional check should be done and if the sizes are different, the header should be updated. A quick test would be to create a loop where you write 1 byte to a test.txt file and then trying to add that file to the archive and extracting the archive.
When adding a file which size is being changed during archiving, the archive would become corrupt because the size in the header is different than the size of the actual data written. So an additional check should be done and if the sizes are different, the header should be updated. A quick test would be to create a loop where you write 1 byte to a test.txt file and then trying to add that file to the archive and extracting the archive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not comfortable merging this until I fully understand what the x header is doing.
@@ -186,7 +186,38 @@ public function test_dogfood() | |||
unlink($archive); | |||
} | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation seem wrong again. please make sure you use 4 spaces for indentation. not tabs!
$filename = trim($this->readbytes(ceil($return['size'] / 512) * 512)); | ||
// next block is the real header | ||
$block = $this->readbytes(512); | ||
$return = $this->parseHeader($block); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. You are not using the data read from x
header. $filename is never used. You basically just read and ignore the x
header.
Since your tests work, I assume the original header already contains the proper UTF-8 filename? Would a very long UTF-8 filename have an x
and an L
header?
Looking at the IBM document you provided in #18 an
So for implementing it correctly, the The header may also contain a Ideally we should also create such a header when adding UTF-8 filenames. |
No description provided.