aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2016-10-18 16:38:54 -0700
committerJoe Tsai <thebrokentoaster@gmail.com>2016-10-20 01:06:09 +0000
commitef8e85e8b8176fb096683dac00cf536fd7d228bc (patch)
tree04d3b2d3e5687b0bd8b1c174104dbee2401acd31 /lib
parentf35b8658dca82f317251f7947964fb2878b57a85 (diff)
downloadgo-ef8e85e8b8176fb096683dac00cf536fd7d228bc.tar.gz
go-ef8e85e8b8176fb096683dac00cf536fd7d228bc.zip
archive/tar: fix parsePAXTime
Issues fixed: * Could not handle quantity of seconds greater than 1<<31 on 32bit machines since strconv.ParseInt did not treat integers as 64b. * Did not handle negative timestamps properly if nanoseconds were used. Note that "-123.456" should result in a call to time.Unix(-123, -456000000). * Incorrectly allowed a '-' right after the '.' (e.g., -123.-456) * Did not detect invalid input after the truncation point (e.g., 123.123456789badbadbad). Note that negative timestamps are allowed by PAX, but are not guaranteed to be portable. See the relevant specification: <<< If pax encounters a file with a negative timestamp in copy or write mode, it can reject the file, substitute a non-negative timestamp, or generate a non-portable timestamp with a leading '-'. >>> Since the previous behavior already partially supported negative timestamps, we are bound by Go's compatibility rules to keep support for them. However, we should at least make sure we handle them properly. Change-Id: I5686997708bfb59110ea7981175427290be737d1 Reviewed-on: https://go-review.googlesource.com/31441 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions