Skip to content

Commit

Permalink
allow wasi read root
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Dec 4, 2024
1 parent fec2bc3 commit a15689f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use wasmtime::{
component::{Linker, ResourceTable},
Config, Engine, Store,
};
use wasmtime_wasi::{StdinStream, StdoutStream, WasiCtxBuilder};
use wasmtime_wasi::{DirPerms, FilePerms, StdinStream, StdoutStream, WasiCtxBuilder};

use host_op_perf::PerfCtx;
use host_op_system::SysCtx;
Expand Down Expand Up @@ -66,6 +66,9 @@ impl PshEngineBuilder {
.context("Failed to link data-export module")?;
}

self.wasi_ctx_builder
.preopened_dir("/", "/", DirPerms::READ, FilePerms::READ)?;

let state = PshState {
name: "PSH Wasi Runtime".to_owned(),
table: ResourceTable::new(),
Expand Down

0 comments on commit a15689f

Please sign in to comment.