From 3cc4ad3c381ee081cfcf0df28ea51507ad5c9b95 Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Fri, 14 Mar 2025 23:13:48 +0800 Subject: [PATCH] fix: allow double `--` in permissions as command can have double `__` (#12884) * allow double `--` in permissions as command can have double `__` * Create change-pr-12884.md * Update .changes/change-pr-12884.md Co-authored-by: Fabian-Lars --------- Co-authored-by: Fabian-Lars --- .changes/change-pr-12884.md | 5 +++++ crates/tauri-utils/src/acl/identifier.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/change-pr-12884.md diff --git a/.changes/change-pr-12884.md b/.changes/change-pr-12884.md new file mode 100644 index 000000000..0a4ae2e8c --- /dev/null +++ b/.changes/change-pr-12884.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": "patch:bug" +--- + +fix: allow double `--` in permissions as command can have double `__` diff --git a/crates/tauri-utils/src/acl/identifier.rs b/crates/tauri-utils/src/acl/identifier.rs index 1693e4195..a95c6d534 100644 --- a/crates/tauri-utils/src/acl/identifier.rs +++ b/crates/tauri-utils/src/acl/identifier.rs @@ -104,7 +104,8 @@ impl ValidByte { (_, IDENTIFIER_SEPARATOR) => Some(ValidByte::Separator), (ValidByte::Separator, next) => ValidByte::alpha_numeric(next), - (ValidByte::Byte(b'-'), next) => ValidByte::alpha_numeric(next), + (ValidByte::Byte(b'-'), next) => ValidByte::alpha_numeric_hyphen(next), + (ValidByte::Byte(b'_'), next) => ValidByte::alpha_numeric_hyphen(next), (ValidByte::Byte(_), next) => ValidByte::alpha_numeric_hyphen(next), } }