From 65c721e088717b5efea786a1697ac97d032e0537 Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Tue, 15 Jul 2025 23:09:04 +0800 Subject: [PATCH] fix: terminal connection on Linux and MacOS (#12307) Signed-off-by: fufesou --- src/server/connection.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/connection.rs b/src/server/connection.rs index 9daf24f78..eedb77995 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1981,7 +1981,7 @@ impl Connection { o.terminal_persistent.enum_value() == Ok(BoolOption::Yes); } self.terminal_service_id = terminal.service_id; - #[cfg(target_os = "windows")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] if let Some(msg) = self.fill_terminal_user_token(&lr.os_login.username, &lr.os_login.password) { @@ -2943,6 +2943,12 @@ impl Connection { true } + #[cfg(any(target_os = "linux", target_os = "macos"))] + fn fill_terminal_user_token(&mut self, _username: &str, _password: &str) -> Option<&'static str> { + self.terminal_user_token = Some(TerminalUserToken::SelfUser); + None + } + // Try to fill user token for terminal connection. // If username is empty, use the user token of the current session. // If username is not empty, try to logon and check if the user is an administrator.