]> Cypherpunks.ru repositories - gostls13.git/commit
os: follow all name surrogate reparse points in Stat on Windows
authorqmuntal <quimmuntal@gmail.com>
Mon, 7 Aug 2023 09:24:13 +0000 (11:24 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 8 Aug 2023 16:00:00 +0000 (16:00 +0000)
commit94e40d5603797fe4d9302421682bb5b997d9c568
treef65ac7683405a4f1eb8d94460bff8a6782d17aa7
parent2c95fa4f31aec5c903947920e9e555f435869359
os: follow all name surrogate reparse points in Stat on Windows

Previously, os.Stat only followed IO_REPARSE_TAG_SYMLINK
and IO_REPARSE_TAG_MOUNT_POINT reparse points.

This CL generalize the logic to detect which reparse points to follow
by using the reparse tag value to determine whether the reparse point
refers to another named entity, as documented in
https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-point-tags.

The new behavior adds implicit support for correctly stat-ing reparse
points other than mount points and symlinks, e.g.,
IO_REPARSE_TAG_WCI_LINK and IO_REPARSE_TAG_IIS_CACHE.

Updates #42184

Change-Id: I51f56127d4dc6c0f43eb5dfa3bfa6d9e3922d000
Reviewed-on: https://go-review.googlesource.com/c/go/+/516555
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
src/os/os_windows_test.go
src/os/stat.go
src/os/stat_windows.go
src/os/types_windows.go