flatpak command line is_root

This commit is contained in:
rustdesk
2025-12-05 17:15:29 +08:00
parent 20ce626654
commit eb0174ea53
2 changed files with 5 additions and 1 deletions

View File

@@ -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()
}

View File

@@ -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()
}