Change the macosx Host::FindProcesses() to include all processes

(running under any uid) if lldb is being run as root.  It might be
better to handle this up at the ProcessInstanceInfoMatch class with
its m_match_all_users ivar instead of down here...

llvm-svn: 139566
This commit is contained in:
Jason Molenda 2011-09-13 00:52:59 +00:00
parent a93ab13e0b
commit 542adbfccf
1 changed files with 4 additions and 0 deletions

View File

@ -1095,6 +1095,10 @@ Host::FindProcesses (const ProcessInstanceInfoMatch &match_info, ProcessInstance
else else
kinfo_user_matches = kinfo.kp_eproc.e_pcred.p_ruid == our_uid; kinfo_user_matches = kinfo.kp_eproc.e_pcred.p_ruid == our_uid;
// Special case, if lldb is being run as root we can attach to anything.
if (our_uid == 0)
kinfo_user_matches = true;
if (kinfo_user_matches == false || // Make sure the user is acceptable if (kinfo_user_matches == false || // Make sure the user is acceptable
kinfo.kp_proc.p_pid == our_pid || // Skip this process kinfo.kp_proc.p_pid == our_pid || // Skip this process
kinfo.kp_proc.p_pid == 0 || // Skip kernel (kernel pid is zero) kinfo.kp_proc.p_pid == 0 || // Skip kernel (kernel pid is zero)