Преглед изворни кода

feat: Use polkit to elevate permission instaed of sudo (#678)

Kimiblock Moe пре 1 година
родитељ
комит
6c1ab6002d
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src-tauri/src/core/manager.rs

+ 1 - 1
src-tauri/src/core/manager.rs

@@ -28,7 +28,7 @@ pub fn grant_permission(core: String) -> anyhow::Result<()> {
     let output = {
         let path = path.replace(' ', "\\ "); // 避免路径中有空格
         let shell = format!("setcap cap_net_bind_service,cap_net_admin=+ep {path}");
-        Command::new("sudo")
+        Command::new("pkexec")
             .arg("sh")
             .arg("-c")
             .arg(shell)