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"
This commit is contained in:
		
							parent
							
								
									07ab8e508c
								
							
						
					
					
						commit
						178d33155f
					
				| @ -1274,8 +1274,13 @@ pub fn check_process(arg: &str, mut same_uid: bool) -> bool { | |||||||
|         if same_uid && p.user_id() != my_uid { |         if same_uid && p.user_id() != my_uid { | ||||||
|             continue; |             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] }; |         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; |             return true; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user