fix: terminal connection on Linux and MacOS (#12307)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-07-15 23:09:04 +08:00
committed by GitHub
parent 69af5f2fa6
commit 65c721e088

View File

@@ -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.