Skip to content

Commit

Permalink
feat: Use polkit to elevate permission instaed of sudo (zzzgydi#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimiblock authored Jul 21, 2023
1 parent 9638eef commit 6c1ab60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src-tauri/src/core/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c1ab60

Please sign in to comment.