diff --git a/.changes/fix-fs-scope-check-symlink.md b/.changes/fix-fs-scope-check-symlink.md new file mode 100644 index 000000000..7804412d4 --- /dev/null +++ b/.changes/fix-fs-scope-check-symlink.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Resolve symlinks on the filesystem scope check. diff --git a/core/tauri/src/scope/fs.rs b/core/tauri/src/scope/fs.rs index 1fa281b2b..11af889c2 100644 --- a/core/tauri/src/scope/fs.rs +++ b/core/tauri/src/scope/fs.rs @@ -298,6 +298,14 @@ impl Scope { /// Determines if the given path is allowed on this scope. pub fn is_allowed>(&self, path: P) -> bool { let path = path.as_ref(); + let path = if path.is_symlink() { + match std::fs::read_link(path) { + Ok(p) => p, + Err(_) => return false, + } + } else { + path.to_path_buf() + }; let path = if !path.exists() { crate::Result::Ok(path.to_path_buf()) } else {