Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix check_process for empty arg since on mac, p.cmd() get "/Applications/RustDesk.app/Contents/MacOS/RustDesk", "XPC_SERVICE_NAME=com.carriez.RustDesk_server"

rustdesk178d33155f45
diff --git a/src/common.rs b/src/common.rs
index 39771c541..4d2f4c62b 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -1274,8 +1274,13 @@ pub fn check_process(arg: &str, mut same_uid: bool) -> bool {
if same_uid && p.user_id() != my_uid {
continue;
}
+ // on mac, p.cmd() get "/Applications/RustDesk.app/Contents/MacOS/RustDesk", "XPC_SERVICE_NAME=com.carriez.RustDesk_server"
let parg = if p.cmd().len() <= 1 { "" } else { &p.cmd()[1] };
- if arg == parg {
+ if arg.is_empty() {
+ if !parg.starts_with("--") {
+ return true;
+ }
+ } else if arg == parg {
return true;
}
}