]> Cypherpunks repositories - gostls13.git/commit
os: support Stat and LStat for CON device on Windows
authorqmuntal <quimmuntal@gmail.com>
Fri, 2 Feb 2024 15:30:54 +0000 (16:30 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 7 Feb 2024 20:53:05 +0000 (20:53 +0000)
commit28b8851671a0254ed0e46ce8dbec43ebe73e7132
tree6b24a38ffc333b251fd2894ebff0dba536eb9c64
parente55bf08d98b163e6f94d164fc650d2e427bc9c3b
os: support Stat and LStat for CON device on Windows

\\.\con and CON need to be opened with GENERIC_READ access, else
CreateFile will fail with ERROR_INVALID_PARAMETER.

Special-case ERROR_INVALID_PARAMETER in os.[L]Stat so it retries with
GENERIC_READ access.

Fixes #34900.

Change-Id: I5010e736d0189c8ada4fc0eca98d71a438c41426
Reviewed-on: https://go-review.googlesource.com/c/go/+/560755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/os/stat_test.go
src/os/stat_windows.go