preopens with Caps::all, implement create, remove dir, remove file

This commit is contained in:
Pat Hickey
2020-12-16 15:15:48 -08:00
parent c0461ca170
commit 27ddbda829
5 changed files with 80 additions and 20 deletions

View File

@@ -100,7 +100,7 @@ impl WasiCtxBuilder {
dir: Box<dyn WasiDir>,
path: impl AsRef<Path>,
) -> Result<&mut Self, Error> {
let caps = DirCaps::OPEN | DirCaps::CREATE_FILE; // XXX more base caps
let caps = DirCaps::all();
let file_caps = FileCaps::READ | FileCaps::WRITE; // XXX more base caps
self.0.table().push(Box::new(DirEntry::new(
caps,