summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/purge.cpp
diff options
context:
space:
mode:
authorAnthony Iacono <anthonyiacono@gmail.com>2022-08-20 18:21:01 -0400
committerAndreas Kling <kling@serenityos.org>2022-08-22 12:46:32 +0200
commitf86b671de23a7eb76e8ddb3460369c053f726384 (patch)
tree59fb1eddeb2cbcae124c31503ab8c10b3be5dd34 /Kernel/Syscalls/purge.cpp
parent8026d8926c703b819ce8384d7abc7fe4dfc42d2b (diff)
downloadserenity-f86b671de23a7eb76e8ddb3460369c053f726384.zip
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.
Diffstat (limited to 'Kernel/Syscalls/purge.cpp')
-rw-r--r--Kernel/Syscalls/purge.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Syscalls/purge.cpp b/Kernel/Syscalls/purge.cpp
index 0cf7a5ede2..0512c52f03 100644
--- a/Kernel/Syscalls/purge.cpp
+++ b/Kernel/Syscalls/purge.cpp
@@ -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) {