From fc5ca965ba92c60128cdd05b72d760512aea0eb9 Mon Sep 17 00:00:00 2001 From: GyDi Date: Fri, 17 Mar 2023 08:36:19 +0800 Subject: [PATCH] fix: escape path space --- src-tauri/src/core/manager.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/src/core/manager.rs b/src-tauri/src/core/manager.rs index dfba550..6effb45 100644 --- a/src-tauri/src/core/manager.rs +++ b/src-tauri/src/core/manager.rs @@ -25,6 +25,7 @@ pub fn grant_permission(core: String) -> anyhow::Result<()> { #[cfg(target_os = "linux")] let output = { + let path = path.replace(' ', "\\ "); // 避免路径中有空格 let shell = format!("setcap cap_net_bind_service,cap_net_admin=+ep {path}"); Command::new("sudo") .arg("sh")