mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
workaround of issue #2756
This commit is contained in:
parent
c01dfc9af3
commit
e752c726ed
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user