Skip to content
Snippets Groups Projects
Unverified Commit 6c1ab600 authored by Kimiblock Moe's avatar Kimiblock Moe Committed by GitHub
Browse files

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

parent 9638eefc
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment