From 6a6b09b431e6270ebf3c8944d8b36ee5d4a8f8cf Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Fri, 18 Jun 2021 20:42:04 +0200 Subject: Darwin: Always update username --- darwin/DarwinProcessList.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'darwin/DarwinProcessList.c') diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index b50c5b8c..900677ae 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -213,6 +213,11 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], preExisting); DarwinProcess_setFromLibprocPidinfo(proc, dpl, time_interval); + if (proc->super.st_uid != ps[i].kp_eproc.e_ucred.cr_uid) { + proc->super.st_uid = ps[i].kp_eproc.e_ucred.cr_uid; + proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid); + } + // Disabled for High Sierra due to bug in macOS High Sierra bool isScanThreadSupported = ! ( CompareKernelVersion(17, 0, 0) >= 0 && CompareKernelVersion(17, 5, 0) < 0); @@ -223,8 +228,6 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { super->totalTasks += 1; if (!preExisting) { - proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid); - ProcessList_add(super, &proc->super); } } -- cgit v1.2.3