mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 22:11:30 +08:00
flatpak command line is_root
This commit is contained in:
@@ -803,6 +803,10 @@ fn is_root() -> bool {
|
||||
return crate::platform::is_elevated(None).unwrap_or_default()
|
||||
|| crate::platform::is_root();
|
||||
}
|
||||
#[cfg(linux)]
|
||||
{
|
||||
return crate::platform::is_flatpak() || crate::platform::is_root();
|
||||
}
|
||||
#[allow(unreachable_code)]
|
||||
crate::platform::is_root()
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ pub fn get_env_var(k: &str) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_flatpak() -> bool {
|
||||
pub fn is_flatpak() -> bool {
|
||||
std::path::PathBuf::from("/.flatpak-info").exists()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user