]> Cypherpunks repositories - gostls13.git/commit
os: add os.ModeSocket support to os.Stat on windows
authorqmuntal <quimmuntal@gmail.com>
Wed, 7 Feb 2024 16:40:24 +0000 (17:40 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 12 Feb 2024 07:15:06 +0000 (07:15 +0000)
commit628b1015b972eabcc0a678ab69a74601239c40a4
treec97e808100fa5ba5f85d5f8e564224a4a9cd2323
parent4a7f3ac8eb4381ea62caa1741eeeec28363245b4
os: add os.ModeSocket support to os.Stat on windows

Unix sockets are identified by the IO_REPARSE_TAG_AF_UNIX reparse tag.

Teach fileStat.Mode() to recognize this tag and set the os.ModeSocket
bit in such case.

Note that there is a bug starting in Windows 19H1 until 20H1 that
makes the IO_REPARSE_TAG_AF_UNIX tag not being set for unix sockets.
This CL doesn't provide a workaround for this bug.

Fixes #33357.

Change-Id: Iea8f24b20672c8d4b03f55ef298d128431dc3fac
Reviewed-on: https://go-review.googlesource.com/c/go/+/561937
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/internal/syscall/windows/reparse_windows.go
src/net/unixsock_windows_test.go
src/os/types_windows.go