dispatchrun / wasi-go

A Go implementation of the WebAssembly System Interface (WASI)
Apache License 2.0
124 stars 7 forks source link

don't allow closing on renumber of preopen #6

Closed achille-roussel closed 1 year ago

achille-roussel commented 1 year ago

This PR adds validation that preopens cannot be closed nor renumbered, and that preopens cannot be opened by the host after the guest has opened its own files.

I also modified the mechanism for testing whether a file is a propen to compare the fd number to the highest preopen number (+1), and changed the fields of fdinfo to be unexported (since the type is unexported as well).

Let me know if anything should be changed!

achille-roussel commented 1 year ago

Uh... wasi-testsuite has been shape shifting, everything I thought I know is wrong! https://github.com/WebAssembly/wasi-testsuite/commit/06812ece7bb884cec4508c26ab837cb918186bfc

achille-roussel commented 1 year ago

I found a bug in https://github.com/stealthrocket/wasi/pull/6/commits/67c8b195ffc9a2d7aa2d512c5afb401af73e9ab5