]> Cypherpunks repositories - gostls13.git/commit
syscall: keep write access when O_TRUNC is used on Windows
authorqmuntal <quimmuntal@gmail.com>
Wed, 16 Oct 2024 14:18:45 +0000 (16:18 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Fri, 18 Oct 2024 04:09:36 +0000 (04:09 +0000)
commit6853d89477e0886c7c96b08e7efaf74abedfcf71
treef25d731e65c81359dc51c1f6fd7b5afdaec6b68a
parente45c125a3c343767b3bb68f3512d8cffbf7691b9
syscall: keep write access when O_TRUNC is used on Windows

CL 618836 introduces a regression where O_APPEND and O_TRUNC could
not be used together on Windows.

This CL fixes the issue by keeping the write access when O_TRUNC is used
, which is required when overwriting data (as per the file
access rights docs: https://learn.microsoft.com/en-us/windows/win32/fileio/file-access-rights-constants).

Fixes #69902.

Change-Id: I77ec60ca6929124dd4490bdad6c3280c4db3efcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/620575
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/syscall/syscall_windows.go
src/syscall/syscall_windows_test.go