workaround of issue #2756

This commit is contained in:
rustdesk 2023-06-29 23:46:00 +08:00
parent c01dfc9af3
commit e752c726ed

View File

@ -667,8 +667,12 @@ pub fn check_super_user_permission() -> ResultType<bool> {
} else {
arg = "echo";
}
let status = exec_privileged(&[arg])?.wait()?;
Ok(status.success() && status.code() == Some(0))
// https://github.com/rustdesk/rustdesk/issues/2756
if let Ok(status) = Command::new("pkexec").arg(arg).status() {
Ok(status.code() != Some(126))
} else {
Ok(true)
}
}
pub fn elevate(args: Vec<&str>) -> ResultType<bool> {