mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-05 00:36:14 +00:00
check super permission: win && linux
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
1 parent
123a7aa17b
commit
4faf0a3d35
7 files changed
+208
-78
No files matched your search
@@ -629,3 +629,9 @@ extern "C" {
|
||||
pub fn quit_gui() {
|
||||
unsafe { gtk_main_quit() };
|
||||
}
|
||||
|
||||
pub fn check_super_user_permission() -> ResultType<bool> {
|
||||
// TODO: replace echo with a rustdesk's program, which is location-fixed and non-gui.
|
||||
let status = std::process::Command::new("pkexec").arg("echo").status()?;
|
||||
Ok(status.success() && status.code() == Some(0))
|
||||
}
|
||||
Reference in new issue
Block a user