diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-06-18 20:42:04 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-06-22 09:32:11 +0200 |
commit | 6a6b09b431e6270ebf3c8944d8b36ee5d4a8f8cf (patch) | |
tree | 46c55d2804ec4dfc84f9e96fbdaf5121b9f32f9c /darwin | |
parent | 8aca6fbfbd6858aab402f3a8700a5116ad5a5008 (diff) |
Darwin: Always update username
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/DarwinProcess.c | 1 | ||||
-rw-r--r-- | darwin/DarwinProcessList.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c index 96d10b0e..2bd6ec71 100644 --- a/darwin/DarwinProcess.c +++ b/darwin/DarwinProcess.c @@ -298,7 +298,6 @@ void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, proc->tgid = proc->pid; proc->isKernelThread = false; proc->isUserlandThread = false; - proc->st_uid = ps->kp_eproc.e_ucred.cr_uid; dp->translated = ps->kp_proc.p_flag & P_TRANSLATED; proc->tty_nr = ps->kp_eproc.e_tdev; 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); } } |