Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(linux): recognize a login screen whose greeter uses another nologin path (#16675)

Lukas21c488b6ce80
diff --git a/src/platform/linux.rs b/src/platform/linux.rs
index ef06c98f3..beed657d3 100644
--- a/src/platform/linux.rs
+++ b/src/platform/linux.rs
@@ -1424,7 +1424,17 @@ pub fn is_prelogin() -> bool {
}
let name = get_active_username();
if let Ok(res) = run_cmds(&format!("getent passwd {}", name)) {
- return res.contains("/bin/false") || res.contains("/usr/sbin/nologin");
+ return res.lines().any(|entry| {
+ let shell = entry.trim().rsplit(':').next().unwrap_or_default();
+ matches!(
+ shell,
+ "/bin/false"
+ | "/usr/bin/false"
+ | "/usr/sbin/nologin"
+ | "/sbin/nologin"
+ | "/usr/bin/nologin"
+ )
+ });
}
false
}