Skip to content

Commit

Permalink
Return Notsup for absolute symlinks instead of panicking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boomshroom authored and theduke committed Feb 1, 2024
1 parent 7349e1c commit c7218c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wasix/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7218c9

Please sign in to comment.