diff options
author | Joe Tsai <joetsai@digital-static.net> | 2018-02-23 15:08:11 -0800 |
---|---|---|
committer | Joe Tsai <joetsai@google.com> | 2018-02-23 23:48:32 +0000 |
commit | 9697a119e6af9fd08080e7765d8ba75d715117a6 (patch) | |
tree | 02fcf94d71667909d01918a774d4e783d4531083 /src/archive/zip/reader_test.go | |
parent | 804e3e565e98e1ff3a22eb354a473225f6dc7351 (diff) | |
download | go-9697a119e6af9fd08080e7765d8ba75d715117a6.tar.gz go-9697a119e6af9fd08080e7765d8ba75d715117a6.zip |
archive/zip: fix handling of Info-ZIP Unix extended timestamps
The Info-ZIP Unix1 extra field is specified as such:
>>>
Value Size Description
----- ---- -----------
0x5855 Short tag for this extra block type ("UX")
TSize Short total data size for this block
AcTime Long time of last access (GMT/UTC)
ModTime Long time of last modification (GMT/UTC)
<<<
The previous handling was incorrect in that it read the AcTime field
instead of the ModTime field.
The test-osx.zip test unfortunately locked in the wrong behavior.
Manually parsing that ZIP file shows that the encoded MS-DOS
date and time are 0x4b5f and 0xa97d, which corresponds with a
date of 2017-10-31 21:11:58, which matches the correct mod time
(off by 1 second due to MS-DOS timestamp resolution).
Fixes #23901
Change-Id: I567824c66e8316b9acd103dbecde366874a4b7ef
Reviewed-on: https://go-review.googlesource.com/96895
Run-TryBot: Joe Tsai <joetsai@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/archive/zip/reader_test.go')
-rw-r--r-- | src/archive/zip/reader_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go index 0d9040f767..1e58b26b6e 100644 --- a/src/archive/zip/reader_test.go +++ b/src/archive/zip/reader_test.go @@ -414,7 +414,7 @@ var tests = []ZipTest{ Name: "test.txt", Content: []byte{}, Size: 1<<32 - 1, - Modified: time.Date(2017, 10, 31, 21, 17, 27, 0, timeZone(-7*time.Hour)), + Modified: time.Date(2017, 10, 31, 21, 11, 57, 0, timeZone(-7*time.Hour)), Mode: 0644, }, }, |