Closed kulcsaradam closed 7 months ago
@kulcsaradam Would you please elaborate more about the following?
Implement the mapping of real directories to virtual ones so that WASI can use different directories.
What is the main feature of mapping directories and where is this used?
@clover2123 Of course, my sources: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-overview.md - Section: Capability-Oriented
WASI by design has an idea, where for security reasons runtimes may not allow programs to freely move between host directories. By default they only allow files to manipulate in their own directories and in directories which they have handles to. Also, to obfuscate the system they are on, inside they use virtual directories like '/var' or '/home' which are actualy directories like 'home/user/walrus/test' for example.
Use cases are any file manipulation operations like reading from a file or writing to one.
I hope this is an acceptable answer!
The pr was closed by a mistake I caused while tinkering with Visual Studio. Reopened it now.
Refactor the importing of WASI functions to be clearer. Implement path_open, fd_seek, fd_read, environ_sizes_get, environ_get for file acces. Implement the mapping of real directories to virtual ones so that WASI can use different directories. Add flag '--mapdirs' '
real
' 'virtual
' for mapping directories. Add flag '--env' for sharing host envrionment variables. Add flag '--help' for printing available walrus options. Also improve random_get test to not have a result.