summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/pledge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls/pledge.cpp')
-rw-r--r--Kernel/Syscalls/pledge.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/pledge.cpp b/Kernel/Syscalls/pledge.cpp
index b03a011598..ae9e7d2d71 100644
--- a/Kernel/Syscalls/pledge.cpp
+++ b/Kernel/Syscalls/pledge.cpp
@@ -53,7 +53,7 @@ KResultOr<FlatPtr> Process::sys$pledge(Userspace<const Syscall::SC_pledge_params
u32 new_promises = 0;
if (!parse_pledge(promises, new_promises))
return EINVAL;
- if (m_promises && (!new_promises || new_promises & ~m_promises))
+ if (m_has_promises && (new_promises & ~m_promises))
return EPERM;
m_has_promises = true;
@@ -64,7 +64,7 @@ KResultOr<FlatPtr> Process::sys$pledge(Userspace<const Syscall::SC_pledge_params
u32 new_execpromises = 0;
if (!parse_pledge(execpromises, new_execpromises))
return EINVAL;
- if (m_execpromises && (!new_execpromises || new_execpromises & ~m_execpromises))
+ if (m_has_execpromises && (new_execpromises & ~m_execpromises))
return EPERM;
m_has_execpromises = true;
m_execpromises = new_execpromises;