]> Cypherpunks repositories - gostls13.git/commit
archive/zip: fix character device handling in fileModeToUnixMode
authorTom Thorogood <me+google@tomthorogood.co.uk>
Fri, 12 Mar 2021 13:57:30 +0000 (00:27 +1030)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Sat, 3 Apr 2021 20:16:00 +0000 (20:16 +0000)
commitdac136f87b9d5fdda9b5c33dfa0f94dc8c9880c7
treec94393d4fd1020b081d5985a27f7392a20307cd8
parent971c7154b04d8dd00da932a26ecb6bb8d8fc133d
archive/zip: fix character device handling in fileModeToUnixMode

The switch case for fs.ModeDevice can only be reached for block devices
while character devices match fs.ModeDevice | fs.ModeCharDevice. This
would cause character devices to wrongly be reported as regular files.

This bug has existed since the switch was first introduced in CL 5624048.

Change-Id: Icdbedb015e5376b385b3115d2e4574daa052f796
Reviewed-on: https://go-review.googlesource.com/c/go/+/300891
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
src/archive/zip/struct.go
src/archive/zip/writer_test.go