mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-17 02:01:01 +03:00
mac admin auth check
This commit is contained in:
@@ -34,6 +34,7 @@ extern "C" {
|
||||
static kAXTrustedCheckOptionPrompt: CFStringRef;
|
||||
fn AXIsProcessTrustedWithOptions(options: CFDictionaryRef) -> BOOL;
|
||||
fn InputMonitoringAuthStatus(_: BOOL) -> BOOL;
|
||||
fn MacCheckAdminAuthorization() -> BOOL;
|
||||
fn MacGetModeNum(display: u32, numModes: *mut u32) -> BOOL;
|
||||
fn MacGetModes(
|
||||
display: u32,
|
||||
@@ -665,3 +666,10 @@ pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType<
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
pub fn check_super_user_permission() -> ResultType<bool> {
|
||||
unsafe {
|
||||
Ok(MacCheckAdminAuthorization() == YES)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user