]> Cypherpunks repositories - gostls13.git/commit
syscall: fix opening of directories on wasip1
authorAchille Roussel <achille.roussel@gmail.com>
Sat, 29 Apr 2023 18:17:25 +0000 (11:17 -0700)
committerGopher Robot <gobot@golang.org>
Sun, 30 Apr 2023 00:23:53 +0000 (00:23 +0000)
commit4b66502ddaa264257343aae58395ef8cd4176cfd
treec16ba04ea555cf45f006d507a1420d458f33cdf5
parent4badad8d477ffd7a6b762c35bc69aed82faface7
syscall: fix opening of directories on wasip1

Go programs targeting GOOS=wasip1 were failing to open directories when
executed with runtimes like wasmtime or wasmedge due to requesting
rights for operations that are not supported on directories such as
fd_read, fd_write, etc...

This change addresses the issue by performing a second path_open when
observing EISDIR, and masking the requested rights to only ask for
permissions to perform operations supported by a directory.

Change-Id: Ibf65acf4a38bc848a649f41dbd026507d8b63c82
Reviewed-on: https://go-review.googlesource.com/c/go/+/490755
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/syscall/fs_wasip1.go