From 6c1ab6002d21aba22dde5a96b52dd9d5693dbb56 Mon Sep 17 00:00:00 2001 From: Kimiblock Moe <61745317+Kimiblock@users.noreply.github.com> Date: Fri, 21 Jul 2023 23:05:33 +0800 Subject: [PATCH] feat: Use polkit to elevate permission instaed of sudo (#678) --- src-tauri/src/core/manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/core/manager.rs b/src-tauri/src/core/manager.rs index 44c0151..d15e6f5 100644 --- a/src-tauri/src/core/manager.rs +++ b/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)