syscall: Windows does not respect permission bits passed to Open #35033
In the course of testing #31481, I found the following failure on the
This suggests that either the
The text was updated successfully, but these errors were encountered:
Chmod toggles the FILE_ATTRIBUTES_READONLY flag depending on the permission bits. That's a bit odd but I guess some compromises were made at some point and this is what was chosen to map to a Unix concept that Windows doesn't really have in the same way. That's fine. However, the logic used in Chmod was forgotten from Open, which then manifested itself in various places, most recently, go modules' read-only behavior. This corresonds with the syscall CL 202439. Updates golang/go#35033 Change-Id: Id8e74c5205057a74a35eda213516780b79a2aed2 Reviewed-on: https://go-review.googlesource.com/c/sys/+/202440 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Bryan C. Mills <firstname.lastname@example.org> Reviewed-by: Alex Brainman <email@example.com>
In the fix for golang/go#35033 Go started creating read-only files on Windows when no read permission bit was requested in the OpenFile call. This was not documented in the release notes (but see https://go-review.googlesource.com/c/go/+/223957/). Deal with the immediate issue by adding owner-read and owner-write permissions in our WriteFile which creates the file. Also add a workaround for the fact that previous version of Fleetspeak have left behind read-only files - simply clear the read-only attribute if the file already exists.
…ermissions For #35033 For #36878 Change-Id: Ie15353322d5cfe7320199103ad9543fb89a842ed Reviewed-on: https://go-review.googlesource.com/c/go/+/223957 Reviewed-by: Brendan Jackman <firstname.lastname@example.org> Reviewed-by: Bryan C. Mills <email@example.com> (cherry picked from commit e39de05) Reviewed-on: https://go-review.googlesource.com/c/go/+/223962 Reviewed-by: Dmitri Shuralyov <firstname.lastname@example.org>