An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
Rust androidanydeskdartflatpakflutterflutter-appsioslinuxmacosp2prdpremote-controlremote-desktoprustrust-langteamviewervncwaylandwindows
fix: linux workaround cmd path (#12172)
fufesoubb6e080c1c69
diff --git a/libs/hbb_common b/libs/hbb_commonindex 92ca2ca8b..3454fe8c6 160000--- a/libs/hbb_common+++ b/libs/hbb_common@@ -1 +1 @@-Subproject commit 92ca2ca8be6c54d3977e35292d378dfbe90908fc+Subproject commit 3454fe8c60d32ee5033d04fc72466eebb5873880diff --git a/src/platform/gtk_sudo.rs b/src/platform/gtk_sudo.rsindex 9aeea1e2b..fca6403f6 100644--- a/src/platform/gtk_sudo.rs+++ b/src/platform/gtk_sudo.rs@@ -5,7 +5,9 @@ use crate::lang::translate;use gtk::{glib, prelude::*};use hbb_common::{anyhow::{bail, Error},- log, ResultType,+ log,+ platform::linux::CMD_SH,+ ResultType,};use nix::{libc::{fcntl, kill},@@ -468,7 +470,7 @@ fn child(su_user: Option<String>, args: Vec<String>) -> ResultType<()> {if su_user.is_some() {params.push("-S".to_string());}- params.push("/bin/sh".to_string());+ params.push(CMD_SH.to_string());params.push("-c".to_string());let command = argsdiff --git a/src/platform/linux.rs b/src/platform/linux.rsindex 18a8ab172..7d8b781a7 100644--- a/src/platform/linux.rs+++ b/src/platform/linux.rs@@ -10,6 +10,7 @@ use hbb_common::{libc::{c_char, c_int, c_long, c_void},log,message_proto::{DisplayInfo, Resolution},+ platform::linux::{CMD_PS, CMD_SH},regex::{Captures, Regex},};use std::{@@ -320,7 +321,7 @@ fn set_x11_env(desktop: &Desktop) {#[inline]fn stop_rustdesk_servers() {let _ = run_cmds(&format!(- r##"ps -ef | grep -E '{} +--server' | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##,+ r##"ps -ef | grep -E '{} +--server' | awk '{{print $2}}' | xargs -r kill -9"##,crate::get_app_name().to_lowercase(),));}@@ -328,11 +329,11 @@ fn stop_rustdesk_servers() {#[inline]fn stop_subprocess() {let _ = run_cmds(&format!(- r##"ps -ef | grep '/etc/{}/xorg.conf' | grep -v grep | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##,+ r##"ps -ef | grep '/etc/{}/xorg.conf' | grep -v grep | awk '{{print $2}}' | xargs -r kill -9"##,crate::get_app_name().to_lowercase(),));let _ = run_cmds(&format!(- r##"ps -ef | grep -E '{} +--cm-no-ui' | grep -v grep | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##,+ r##"ps -ef | grep -E '{} +--cm-no-ui' | grep -v grep | awk '{{print $2}}' | xargs -r kill -9"##,crate::get_app_name().to_lowercase(),));}@@ -517,7 +518,8 @@ pub fn get_active_userid() -> String {}fn get_cm() -> bool {- if let Ok(output) = Command::new("ps").args(vec!["aux"]).output() {+ // We use `CMD_PS` instead of `ps` to suppress some audit messages on some systems.+ if let Ok(output) = Command::new(CMD_PS.as_str()).args(vec!["aux"]).output() {for line in String::from_utf8_lossy(&output.stdout).lines() {if line.contains(&format!("{} --cm",@@ -1355,7 +1357,8 @@ pub fn run_me_with(secs: u32) {.unwrap_or("".into()).to_string_lossy().to_string();- std::process::Command::new("sh")+ // We use `CMD_SH` instead of `sh` to suppress some audit messages on some systems.+ std::process::Command::new(CMD_SH.as_str()).arg("-c").arg(&format!("sleep {secs}; {exe}")).spawn()