-
Notifications
You must be signed in to change notification settings - Fork 196
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
Archive corrupted when contents added after header creation #282
Comments
elbe0046
added a commit
to elbe0046/tar-rs
that referenced
this issue
Mar 3, 2022
Addresses alexcrichton#282. Signed-off-by: Grant Elbert <grant.elbert@smartthings.com>
elbe0046
added a commit
to elbe0046/tar-rs
that referenced
this issue
Mar 3, 2022
Addresses alexcrichton#282. Signed-off-by: Grant Elbert <grant.elbert@smartthings.com>
elbe0046
added a commit
to elbe0046/tar-rs
that referenced
this issue
Mar 3, 2022
Addresses alexcrichton#282. Signed-off-by: Grant Elbert <grant.elbert@smartthings.com>
elbe0046
added a commit
to elbe0046/tar-rs
that referenced
this issue
Mar 3, 2022
Addresses alexcrichton#282. Signed-off-by: Grant Elbert <grant.elbert@smartthings.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If additional contents have been appended to a file after the Header is created but before the file contents are written to the archive the archive can become corrupted. Particularly if the additional contents straddle a 512-byte boundary.
Such that a tar -tf on the resulting archive reveals the following errors:
OS X
Linux
For example, this can happen when building an archive from log files, where processes are continually writing to the file even during the archiving process.
Upon inspecting a corrupted archive we see for a file
file1
that has had additional contents written since header creation:file1
starts at 0x0032c400file
is 0x001C991B, so the next record should start at 0x004F5E00 (because this calculation is rounded up to the nearest 512 byte alignment)file1
contents exceed what the header specifies, ending at 0x00526A19file2
's header begins at 0x00526c00The text was updated successfully, but these errors were encountered: