[go][fdio] Always add GET_ATTRIBUTES in PosixFlagsToFuchsiaIo POSIX requires that `fstat` succeeds on a valid file descriptor, so we must always open with `fileIo.FlagsPermGetAttributes`. This is required as new VFS changes will enforce GET_ATTRIBUTES permissions. Also, evaluate the O_RDONLY and O_WRONLY and O_RDWR only if O_PATH is not specified. If we don't do this calling `open(..., O_PATH)` will evaluate to opening as O_RDONLY (because O_RDONLY == 0) which would lead to ACCESS_DENIED errors when executing `O_PATH` on a write-only or restricted file. Bug: 517452382 TAG: agy CONV: 17bf7e1b-bf30-4c05-bf61-a5856495709c Change-Id: Ib6b1669feb3ad27ad22021207db62aeb31dec8ed Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/go/+/1726229 Reviewed-by: Bruno Dal Bo <brunodalbo@google.com> Commit-Queue: Rui Qi Sim <rqsim@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.