From 805fe3ee99b365c569ed87ee613b94ef43415feb Mon Sep 17 00:00:00 2001 From: fufesou Date: Wed, 9 Apr 2025 13:55:57 +0800 Subject: [PATCH 1/8] conf key, auto update Signed-off-by: fufesou --- src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.rs b/src/config.rs index 3a944f0..950f2a8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2307,6 +2307,7 @@ pub mod keys { pub const OPTION_TEXTURE_RENDER: &str = "use-texture-render"; pub const OPTION_ALLOW_D3D_RENDER: &str = "allow-d3d-render"; pub const OPTION_ENABLE_CHECK_UPDATE: &str = "enable-check-update"; + pub const OPTION_ALLOW_AUTO_UPDATE: &str = "allow-auto-update"; pub const OPTION_SYNC_AB_WITH_RECENT_SESSIONS: &str = "sync-ab-with-recent-sessions"; pub const OPTION_SYNC_AB_TAGS: &str = "sync-ab-tags"; pub const OPTION_FILTER_AB_BY_INTERSECTION: &str = "filter-ab-by-intersection"; From a26f25a04501f599f1f2a317f4cbd057730057f7 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Sun, 13 Apr 2025 23:39:02 +0800 Subject: [PATCH 2/8] tokio 1.44 --- Cargo.toml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 58f54ac..47d2e31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -flexi_logger = { version = "0.27", features = ["async"] } -protobuf = { version = "3.4", features = ["with-bytes"] } -tokio = { version = "1.38", features = ["full"] } +flexi_logger = { version = "0.30", features = ["async"] } +protobuf = { version = "3.7", features = ["with-bytes"] } +tokio = { version = "1.44", features = ["full"] } tokio-util = { version = "0.7", features = ["full"] } futures = "0.3" -bytes = { version = "1.6", features = ["serde"] } +bytes = { version = "1.10", features = ["serde"] } log = "0.4" -env_logger = "0.10" +env_logger = "0.11" socket2 = { version = "0.3", features = ["reuseport"] } zstd = "0.13" anyhow = "1.0" @@ -24,26 +24,27 @@ rand = "0.8" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" -lazy_static = "1.4" +lazy_static = "1.5" confy = { git = "https://github.com/rustdesk-org/confy" } dirs-next = "2.0" filetime = "0.2" sodiumoxide = "0.2" -regex = "1.8" +regex = "1.11" tokio-socks = { git = "https://github.com/rustdesk-org/tokio-socks" } chrono = "0.4" backtrace = "0.3" libc = "0.2" dlopen = "0.1" toml = "0.7" -uuid = { version = "1.3", features = ["v4"] } +uuid = { version = "1.16", features = ["v4"] } # new sysinfo issue: https://github.com/rustdesk/rustdesk/pull/6330#issuecomment-2270871442 sysinfo = { git = "https://github.com/rustdesk-org/sysinfo", branch = "rlim_max" } -thiserror = "1.0" -httparse = "1.5" +thiserror = "2.0" +httparse = "1.10" base64 = "0.22" -url = "2.2" +url = "2.5" sha2 = "0.10" +tokio-tungstenite = "0.26" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] mac_address = "1.1" @@ -51,13 +52,13 @@ default_net = { git = "https://github.com/rustdesk-org/default_net" } machine-uid = { git = "https://github.com/rustdesk-org/machine-uid" } [target.'cfg(not(any(target_os = "macos", target_os = "windows")))'.dependencies] tokio-rustls = { version = "0.26", features = ["logging", "tls12", "ring"], default-features = false } -rustls-platform-verifier = "0.3.1" -rustls-pki-types = "1.4" +rustls-platform-verifier = "0.5" +rustls-pki-types = "1.11" [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] tokio-native-tls ="0.3" [build-dependencies] -protobuf-codegen = { version = "3.4" } +protobuf-codegen = { version = "3.7" } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["winuser", "synchapi", "pdh", "memoryapi", "sysinfoapi"] } From 5cc7db26767651b3cd9c33f0b90136ec4002d394 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:40:10 +0800 Subject: [PATCH 3/8] Update Cargo.toml --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 47d2e31..a3937b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -flexi_logger = { version = "0.30", features = ["async"] } +# new flexi_logger failed on rustc 1.75 +flexi_logger = { version = "0.27", features = ["async"] } protobuf = { version = "3.7", features = ["with-bytes"] } tokio = { version = "1.44", features = ["full"] } tokio-util = { version = "0.7", features = ["full"] } From 9e4b3f96962a259ad4be1378e7f258c3982c26d1 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:00:55 +0800 Subject: [PATCH 4/8] Update Cargo.toml --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a3937b8..3c6b72e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,8 @@ toml = "0.7" uuid = { version = "1.16", features = ["v4"] } # new sysinfo issue: https://github.com/rustdesk/rustdesk/pull/6330#issuecomment-2270871442 sysinfo = { git = "https://github.com/rustdesk-org/sysinfo", branch = "rlim_max" } -thiserror = "2.0" +# new flexi_logger failed on nightly rustc 1.75 for x86 +thiserror = "1.0" httparse = "1.10" base64 = "0.22" url = "2.5" From 1ed5a469cfa2318b4045859cab6c88889717193a Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Fri, 18 Apr 2025 11:31:59 +0800 Subject: [PATCH 5/8] Update config.rs --- src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.rs b/src/config.rs index 950f2a8..e65a79f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2473,6 +2473,7 @@ pub mod keys { OPTION_ENABLE_CLIPBOARD, OPTION_ENABLE_FILE_TRANSFER, OPTION_ENABLE_CAMERA, + OPTION_ENABLE_REMOTE_PRINTER, OPTION_ENABLE_AUDIO, OPTION_ENABLE_TUNNEL, OPTION_ENABLE_REMOTE_RESTART, From 514ef6ac0838daa348723a71ffb25bd7aec24070 Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Sat, 19 Apr 2025 01:09:53 +0800 Subject: [PATCH 6/8] Ignore unspecified type session(s) when look through all active sessions With modern systemd versions, there is a manager class session, which is of type "unspecified", for each logged-in / lingering user. Such session should be ignored when attempt to find an appropriate session from all (non-seated) sessions, otherwise it will prevent XDG_SESSION_TYPE (and its "x11" fallback) from being leveraged. --- src/platform/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 60c8714..622685b 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -175,7 +175,7 @@ fn _get_values_of_seat0(indices: &[usize], ignore_gdm_wayland: bool) -> Vec Date: Sat, 19 Apr 2025 01:32:41 +0800 Subject: [PATCH 7/8] Ignore the session type when started as a user unit If a user for reasons start the program as user unit (instead of as a system unit or in a session), /proc/self/sessionid may result in the inferred session type being "unspecified" and prevent XDG_SESSION_TYPE from being leveraged (and its "x11" fallback). --- src/platform/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 622685b..504dd73 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -104,7 +104,7 @@ pub fn get_display_server_of_session(session: &str) -> String { } else { "".to_owned() }; - if display_server.is_empty() || display_server == "tty" { + if display_server.is_empty() || display_server == "tty" || display_server == "unspecified" { if let Ok(sestype) = std::env::var("XDG_SESSION_TYPE") { if !sestype.is_empty() { return sestype.to_lowercase(); From 04772abbef1037b42163acc198f89c938f29b742 Mon Sep 17 00:00:00 2001 From: fufesou Date: Thu, 24 Apr 2025 14:00:53 +0800 Subject: [PATCH 8/8] feat: linux, is locked Signed-off-by: fufesou --- src/platform/linux.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 504dd73..3ec22a7 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -204,6 +204,15 @@ pub fn is_active_and_seat0(sid: &str) -> bool { } } +// Check both "Lock" and "Switch user" +pub fn is_session_locked(sid: &str) -> bool { + if let Ok(output) = run_loginctl(Some(vec!["show-session", sid, "--property=LockedHint"])) { + String::from_utf8_lossy(&output.stdout).contains("LockedHint=yes") + } else { + false + } +} + // **Note** that the return value here, the last character is '\n'. // Use `run_cmds_trim_newline()` if you want to remove '\n' at the end. pub fn run_cmds(cmds: &str) -> ResultType {