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 {
|
} else {
|
||||||
arg = "echo";
|
arg = "echo";
|
||||||
}
|
}
|
||||||
let status = exec_privileged(&[arg])?.wait()?;
|
// https://github.com/rustdesk/rustdesk/issues/2756
|
||||||
Ok(status.success() && status.code() == Some(0))
|
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> {
|
pub fn elevate(args: Vec<&str>) -> ResultType<bool> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user