-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/tar: reader returns bogus headers #12436
Comments
Seems like @dadkins is working on it already. |
I've only tackled subsecond atime, ctime, and mtime. Don't let me stop you from working on the rest of those issues. |
Copy. I'll tackle this, this weekend. |
This should be renamed as: "archive/tar: writer does not support writing base-256 fields" The issue at hand is not that the reader is giving bogus headers, but that the writer isn't able to encode the headers back since it doesn't support the base-256 format that GNU added.
EDIT: I misread the code and it seems that tar does dynamically choose what format to use based on the fields it needs to encode. As I was afraid, this does cause the writer to potentially write conflicting formats if not careful. Issue #9683 is caused by this phenomenon. This will probably be a good time to carefully look through tar and make sure it doesn't conflict with itself. As a side note, I should mention that the reader incorrectly reads base256 encoded fields in that it does not handle negative numbers. I'll submit a CL for that. For reference: The use case of negative numbers allows for timestamps before 1970, and also allows Go's tar implementation to properly reject Tar files with negative file sizes and what not. |
CL https://golang.org/cl/14623 mentions this issue. |
Still not working. Oh well. |
CL https://golang.org/cl/17425 mentions this issue. |
The following program crashes:
The problem is that reader produces the following header:
Mode is bogus. Then, cString tries to serialize that mode in octal format into 8-byte buffer. It does not fit.
I've inserted panic when this error is generated, and there is output:
go version devel +9c514e1 Tue Sep 1 04:00:12 2015 +0000 linux/amd64
The text was updated successfully, but these errors were encountered: