]> Cypherpunks repositories - gostls13.git/commit
archive/tar: roundtrip reading device numbers
authorJoe Tsai <joetsai@digital-static.net>
Mon, 14 Aug 2017 23:14:08 +0000 (16:14 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Tue, 15 Aug 2017 00:54:37 +0000 (00:54 +0000)
commit17fa5a7c9f41bed796b5e236b517d0bf03a3f31d
treed38c766f838a00b7a700ae57d5ef84d1dc9edec5
parent0b06929b2deeedc42706598a7ffc95fcbae91ace
archive/tar: roundtrip reading device numbers

Both GNU and BSD tar do not care if the devmajor and devminor values are
set on entries (like regular files) that aren't character or block devices.

While this is non-sensible, it is more consistent with the Writer to actually
read these fields always. In a vast majority of the cases these will still
be zero. In the rare situation where someone actually cares about these,
at least information was not silently lost.

Change-Id: I6e4ba01cd897a1b13c28b1837e102a4fdeb420ba
Reviewed-on: https://go-review.googlesource.com/55572
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/archive/tar/reader.go
src/archive/tar/reader_test.go
src/archive/tar/testdata/ustar-file-devs.tar [new file with mode: 0644]