-
Notifications
You must be signed in to change notification settings - Fork 18k
archive/tar: Reader doesn't decode binary header fields #4358
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
Labels
Milestone
Comments
Labels changed: added priority-soon, packagebug, removed priority-triage. Owner changed to @dsymonds. Status changed to Accepted. |
I think the same problem will affect other numeric fields, such as Size. Wouldn't it be better to modify Reader.octal, or add a new Reader.numeric function, to decode the binary value if the most significant bit is set? If you do add extra checks to the Writer, I suggest you also return ErrFieldTooLong when len(Header.Name) > 100. Until support is added for longer file names, it's better to report an error instead of silently truncating the value. |
The other fields, I believe, have plenty of space for the range of values permitted by their fields. Bigger numbers already switch to the binary format if required. ModTime is the problematic one because its use of .Unix() yields a negative number that is not even supported by most tars. However, you are right that Reader does not support the binary format at all. That would be the other half of this issue. |
This issue was updated by revision 0ac3178. Still to do: support binary numeric format in Reader. R=golang-dev, rsc CC=golang-dev http://golang.org/cl/6818101 |
This issue was closed by revision 86b9e3e. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: