Closed lendle closed 13 hours ago
If a path has square brackets in it, e.g. /path/[to]/a.txt or /path/to/[a].txt, then that path will not work with fs plugin methods. Even if the path is selected with dialog.open, which should add selected path to allowed scope.
/path/[to]/a.txt
/path/to/[a].txt
Example project: https://github.com/lendle/tauri-app-bad-filenames
path: /path/to/a.txt msg: /path/to/a.txt exists: true error:
[a].txt
path: /path/to/[a].txt msg: error: "forbidden path: /path/to/[a].txt"
### Expected behavior Paths with square brackets should be correctly added to allowed scope ### Full `tauri info` output ```text npm run tauri info > tauri-app-bad-filenames@0.1.0 tauri > tauri info [✔] Environment - OS: Mac OS 14.6.1 arm64 (X64) ✔ Xcode Command Line Tools: installed ✔ rustc: 1.79.0 (129f3b996 2024-06-10) ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03) ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24) ✔ Rust toolchain: 1.79.0-aarch64-apple-darwin (default) - node: 22.5.1 - npm: 10.8.3 [-] Packages - tauri 🦀: 2.1.1 - tauri-build 🦀: 2.0.3 - wry 🦀: 0.47.0 - tao 🦀: 0.30.8 - @tauri-apps/api : 2.1.1 - @tauri-apps/cli : 2.1.0 [-] Plugins - tauri-plugin-fs 🦀: 2.0.3 - @tauri-apps/plugin-fs : 2.0.2 - tauri-plugin-shell 🦀: 2.0.2 - @tauri-apps/plugin-shell : 2.0.1 - tauri-plugin-persisted-scope 🦀: 2.0.3 - @tauri-apps/plugin-persisted-scope : not installed! - tauri-plugin-dialog 🦀: 2.0.3 - @tauri-apps/plugin-dialog : 2.0.1 [-] App - build-type: bundle - CSP: unset - frontendDist: ../build - devUrl: http://localhost:1420/ - framework: Svelte - bundler: Vite
No response
Describe the bug
If a path has square brackets in it, e.g.
/path/[to]/a.txt
or/path/to/[a].txt
, then that path will not work with fs plugin methods. Even if the path is selected with dialog.open, which should add selected path to allowed scope.Reproduction
Example project: https://github.com/lendle/tauri-app-bad-filenames
[a].txt
. You will seeStack trace
No response
Additional context
No response