Kernel: Use Process::credentials() and remove user ID/group ID helpers

Move away from using the group ID/user ID helpers in the process to
allow for us to take advantage of the immutable credentials instead.
This commit is contained in:
Anthony Iacono 2022-08-20 18:21:01 -04:00 committed by Andreas Kling
commit f86b671de2
Notes: sideshowbarker 2024-07-17 08:05:08 +09:00
27 changed files with 109 additions and 94 deletions

View file

@ -16,7 +16,8 @@ ErrorOr<FlatPtr> Process::sys$purge(int mode)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
TRY(require_no_promises());
if (!is_superuser())
auto credentials = this->credentials();
if (!credentials->is_superuser())
return EPERM;
size_t purged_page_count = 0;
if (mode & PURGE_ALL_VOLATILE) {