Open Userzxcvbvnm opened 2 weeks ago
I think it's not a bug but it should be an expected behavior that is not allowed to be done in such a way, that you are trying to escalate permissions(adding write rights to a file descriptor that was originally opened with read-only permissions).
Subject of the issue
fd_fdstat_set_rights fails. I'm not sure whether this is a bug.
Test case
Your environment
Ubuntu 20.04 x86_64 WAMR 1.3.2 and WAMR 1.2.3
Steps to reproduce
Steps to reproduce: (1)compile to wasm:./wasi-sdk-21.0/bin/clang --target=wasm32-unkown-wasi --sysroot=./wasi-sdk-21.0/share/wasi-sysroot test.c -o test.wasm
(2)Running wasm: (Before run the Wasm file, hello.txt exists.) iwasm --dir=. test.wasm
Expected behavior
Successfully set rights and print.
This is what wasmtime do.
Actual behavior