Skip to content

Commit

Permalink
fix check_process for empty arg since on mac, p.cmd() get "/Applicati…
Browse files Browse the repository at this point in the history
…ons/RustDesk.app/Contents/MacOS/RustDesk", "XPC_SERVICE_NAME=com.carriez.RustDesk_server"
  • Loading branch information
rustdesk committed Apr 9, 2024
1 parent 07ab8e5 commit 178d331
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 178d331

Please sign in to comment.