mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 19:15:06 +00:00
Kernel: Allow sending SIGCONT
to processes in the same group
Allow sending `SIGCONT` to processes that share the same `pgid`. This is allowed in Linux aswell. Also fixes a FIXME :^)
This commit is contained in:
parent
9ca979846c
commit
fb2be937ac
1 changed files with 6 additions and 2 deletions
|
@ -11,11 +11,15 @@ namespace Kernel {
|
|||
|
||||
ErrorOr<void> Process::do_kill(Process& process, int signal)
|
||||
{
|
||||
// FIXME: Allow sending SIGCONT to everyone in the process group.
|
||||
// FIXME: Should setuid processes have some special treatment here?
|
||||
auto credentials = this->credentials();
|
||||
auto kill_process_credentials = process.credentials();
|
||||
if (!credentials->is_superuser() && credentials->euid() != kill_process_credentials->uid() && credentials->uid() != kill_process_credentials->uid())
|
||||
|
||||
bool can_send_signal = credentials->is_superuser()
|
||||
|| credentials->euid() == kill_process_credentials->uid()
|
||||
|| credentials->uid() == kill_process_credentials->uid()
|
||||
|| (signal == SIGCONT && credentials->pgid() == kill_process_credentials->pgid());
|
||||
if (!can_send_signal)
|
||||
return EPERM;
|
||||
if (process.is_kernel_process()) {
|
||||
dbgln("Attempted to send signal {} to kernel process {} ({})", signal, process.name(), process.pid());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue