[merge] merge conflict

This commit is contained in:
YinMo19 2025-04-24 22:34:44 +08:00
commit 512f67f25e
3 changed files with 42 additions and 23 deletions

View File

@ -7,14 +7,15 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
# new flexi_logger failed on rustc 1.75
flexi_logger = { version = "0.27", features = ["async"] } flexi_logger = { version = "0.27", features = ["async"] }
protobuf = { version = "3.4", features = ["with-bytes"] } protobuf = { version = "3.7", features = ["with-bytes"] }
tokio = { version = "1.38", features = ["full"] } tokio = { version = "1.44", features = ["full"] }
tokio-util = { version = "0.7", features = ["full"] } tokio-util = { version = "0.7", features = ["full"] }
futures = "0.3" futures = "0.3"
bytes = { version = "1.6", features = ["serde"] } bytes = { version = "1.10", features = ["serde"] }
log = "0.4" log = "0.4"
env_logger = "0.10" env_logger = "0.11"
socket2 = { version = "0.3", features = ["reuseport"] } socket2 = { version = "0.3", features = ["reuseport"] }
zstd = "0.13" zstd = "0.13"
anyhow = "1.0" anyhow = "1.0"
@ -24,32 +25,29 @@ rand = "0.8"
serde_derive = "1.0" serde_derive = "1.0"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
lazy_static = "1.4" lazy_static = "1.5"
confy = { git = "https://github.com/rustdesk-org/confy" } confy = { git = "https://github.com/rustdesk-org/confy" }
dirs-next = "2.0" dirs-next = "2.0"
filetime = "0.2" filetime = "0.2"
sodiumoxide = "0.2" sodiumoxide = "0.2"
regex = "1.8" regex = "1.11"
tokio-socks = { git = "https://github.com/rustdesk-org/tokio-socks" } tokio-socks = { git = "https://github.com/rustdesk-org/tokio-socks" }
chrono = "0.4" chrono = "0.4"
backtrace = "0.3" backtrace = "0.3"
libc = "0.2" libc = "0.2"
dlopen = "0.1" dlopen = "0.1"
toml = "0.7" 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 # new sysinfo issue: https://github.com/rustdesk/rustdesk/pull/6330#issuecomment-2270871442
sysinfo = { git = "https://github.com/rustdesk-org/sysinfo", branch = "rlim_max" } sysinfo = { git = "https://github.com/rustdesk-org/sysinfo", branch = "rlim_max" }
# new flexi_logger failed on nightly rustc 1.75 for x86
thiserror = "1.0" thiserror = "1.0"
httparse = "1.5" httparse = "1.10"
base64 = "0.22" base64 = "0.22"
url = "2.2" url = "2.5"
sha2 = "0.10" sha2 = "0.10"
tokio-tungstenite = {version = "0.26.2", optional = true} tokio-tungstenite = { version = "0.26.2" }
tungstenite = {version = "0.26.2", optional = true} tungstenite = { version = "0.26.2" }
[features]
default = ["websocket"]
websocket = ["dep:tokio-tungstenite", "dep:tungstenite"]
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
@ -57,17 +55,27 @@ mac_address = "1.1"
default_net = { git = "https://github.com/rustdesk-org/default_net" } default_net = { git = "https://github.com/rustdesk-org/default_net" }
machine-uid = { git = "https://github.com/rustdesk-org/machine-uid" } machine-uid = { git = "https://github.com/rustdesk-org/machine-uid" }
[target.'cfg(not(any(target_os = "macos", target_os = "windows")))'.dependencies] [target.'cfg(not(any(target_os = "macos", target_os = "windows")))'.dependencies]
tokio-rustls = { version = "0.26", features = ["logging", "tls12", "ring"], default-features = false } tokio-rustls = { version = "0.26", features = [
rustls-platform-verifier = "0.3.1" "logging",
rustls-pki-types = "1.4" "tls12",
"ring",
], default-features = false }
rustls-platform-verifier = "0.5"
rustls-pki-types = "1.11"
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
tokio-native-tls ="0.3" tokio-native-tls = "0.3"
[build-dependencies] [build-dependencies]
protobuf-codegen = { version = "3.4" } protobuf-codegen = { version = "3.7" }
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3", features = ["winuser", "synchapi", "pdh", "memoryapi", "sysinfoapi"] } winapi = { version = "0.3", features = [
"winuser",
"synchapi",
"pdh",
"memoryapi",
"sysinfoapi",
] }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
osascript = "0.3" osascript = "0.3"

View File

@ -2307,6 +2307,7 @@ pub mod keys {
pub const OPTION_TEXTURE_RENDER: &str = "use-texture-render"; pub const OPTION_TEXTURE_RENDER: &str = "use-texture-render";
pub const OPTION_ALLOW_D3D_RENDER: &str = "allow-d3d-render"; pub const OPTION_ALLOW_D3D_RENDER: &str = "allow-d3d-render";
pub const OPTION_ENABLE_CHECK_UPDATE: &str = "enable-check-update"; 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_WITH_RECENT_SESSIONS: &str = "sync-ab-with-recent-sessions";
pub const OPTION_SYNC_AB_TAGS: &str = "sync-ab-tags"; pub const OPTION_SYNC_AB_TAGS: &str = "sync-ab-tags";
pub const OPTION_FILTER_AB_BY_INTERSECTION: &str = "filter-ab-by-intersection"; pub const OPTION_FILTER_AB_BY_INTERSECTION: &str = "filter-ab-by-intersection";
@ -2472,6 +2473,7 @@ pub mod keys {
OPTION_ENABLE_CLIPBOARD, OPTION_ENABLE_CLIPBOARD,
OPTION_ENABLE_FILE_TRANSFER, OPTION_ENABLE_FILE_TRANSFER,
OPTION_ENABLE_CAMERA, OPTION_ENABLE_CAMERA,
OPTION_ENABLE_REMOTE_PRINTER,
OPTION_ENABLE_AUDIO, OPTION_ENABLE_AUDIO,
OPTION_ENABLE_TUNNEL, OPTION_ENABLE_TUNNEL,
OPTION_ENABLE_REMOTE_RESTART, OPTION_ENABLE_REMOTE_RESTART,

View File

@ -104,7 +104,7 @@ pub fn get_display_server_of_session(session: &str) -> String {
} else { } else {
"".to_owned() "".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 let Ok(sestype) = std::env::var("XDG_SESSION_TYPE") {
if !sestype.is_empty() { if !sestype.is_empty() {
return sestype.to_lowercase(); return sestype.to_lowercase();
@ -175,7 +175,7 @@ fn _get_values_of_seat0(indices: &[usize], ignore_gdm_wayland: bool) -> Vec<Stri
continue; continue;
} }
} }
if d == "tty" { if d == "tty" || d == "unspecified" {
continue; continue;
} }
return line_values(indices, line); return line_values(indices, line);
@ -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'. // **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. // Use `run_cmds_trim_newline()` if you want to remove '\n' at the end.
pub fn run_cmds(cmds: &str) -> ResultType<String> { pub fn run_cmds(cmds: &str) -> ResultType<String> {