From c7218c9089cdc81c6bb908a183a8928f7a816e13 Mon Sep 17 00:00:00 2001 From: Angelo Bulfone Date: Wed, 31 Jan 2024 23:47:37 -0800 Subject: [PATCH] Return Notsup for absolute symlinks instead of panicking Generally when userspace tries to do something the environment can't do (even if it might be able to do it in the future), the usual response is the return a "Not Supported" error, rather than crashing the entire environment. --- lib/wasix/src/fs/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs index b655ba1eced..fd8db0d5978 100644 --- a/lib/wasix/src/fs/mod.rs +++ b/lib/wasix/src/fs/mod.rs @@ -930,7 +930,8 @@ impl WasiFs { let (pre_open_dir_fd, relative_path) = if link_value.is_relative() { self.path_into_pre_open_and_relative_path(&file)? } else { - unimplemented!("Absolute symlinks are not yet supported"); + tracing::error!("Absolute symlinks are not yet supported"); + return Err(Errno::Notsup); }; loop_for_symlink = true; symlink_count += 1;