summaryrefslogtreecommitdiffhomepage
path: root/src/wasm
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
committerKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
commitd8acad350a52a20918c46c09cb0a0f5479400923 (patch)
tree7d9c4b64daa60d3ac121743dfa3735c6fc5687a4 /src/wasm
parent624debcf17ea7faab01fa841bd4dcd9f308cf306 (diff)
parent27bde184dedcbf687db2f314c60c037623318a8d (diff)
downloadunit-d8acad350a52a20918c46c09cb0a0f5479400923.tar.gz
unit-d8acad350a52a20918c46c09cb0a0f5479400923.tar.bz2
Merge tag '1.34.0' into packaging1.34.0-1
Unit 1.34.0 release.
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/nxt_rt_wasmtime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm/nxt_rt_wasmtime.c b/src/wasm/nxt_rt_wasmtime.c
index bf0b0a0f..64ef775d 100644
--- a/src/wasm/nxt_rt_wasmtime.c
+++ b/src/wasm/nxt_rt_wasmtime.c
@@ -281,7 +281,13 @@ nxt_wasmtime_wasi_init(const nxt_wasm_ctx_t *ctx)
wasi_config_inherit_stderr(wasi_config);
for (dir = ctx->dirs; dir != NULL && *dir != NULL; dir++) {
+#if defined(WASMTIME_VERSION_MAJOR) && (WASMTIME_VERSION_MAJOR >= 27)
+ wasi_config_preopen_dir(wasi_config, *dir, *dir,
+ WASMTIME_WASI_DIR_PERMS_READ|WASMTIME_WASI_DIR_PERMS_WRITE,
+ WASMTIME_WASI_FILE_PERMS_READ|WASMTIME_WASI_FILE_PERMS_WRITE);
+#else
wasi_config_preopen_dir(wasi_config, *dir, *dir);
+#endif
}
error = wasmtime_context_set_wasi(rt_ctx->ctx, wasi_config);