浏览代码

fix: escape path space

GyDi 2 年之前
父节点
当前提交
fc5ca965ba
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src-tauri/src/core/manager.rs

+ 1 - 0
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")