forked from Hyperion/HyperionOS
allow hypervisor to kill non-owned processes
This commit is contained in:
@@ -129,9 +129,6 @@ function sys.kill(pid)
|
|||||||
if not tasks[tostring(pid)] then
|
if not tasks[tostring(pid)] then
|
||||||
return false, "Task does not exist"
|
return false, "Task does not exist"
|
||||||
|
|
||||||
elseif not isEqualToAny(tasks[tostring(pid)].pid, table.unpack(children)) and kernel.uid ~= 0 then
|
|
||||||
return false, "You do not own this task"
|
|
||||||
|
|
||||||
elseif tasks[tostring(pid)].status == "Z" then
|
elseif tasks[tostring(pid)].status == "Z" then
|
||||||
return false, "Task is already dead"
|
return false, "Task is already dead"
|
||||||
|
|
||||||
@@ -148,9 +145,6 @@ function sys.stop(pid)
|
|||||||
if not tasks[tostring(pid)] then
|
if not tasks[tostring(pid)] then
|
||||||
return false, "Task does not exist"
|
return false, "Task does not exist"
|
||||||
|
|
||||||
elseif not isEqualToAny(tasks[tostring(pid)].pid, table.unpack(children)) and kernel.uid ~= 0 then
|
|
||||||
return false, "You do not own this task"
|
|
||||||
|
|
||||||
elseif tasks[tostring(pid)].status ~= "R" then
|
elseif tasks[tostring(pid)].status ~= "R" then
|
||||||
return false, "Cannot stop non running task"
|
return false, "Cannot stop non running task"
|
||||||
|
|
||||||
@@ -166,9 +160,6 @@ function sys.continue(pid)
|
|||||||
if not tasks[tostring(pid)] then
|
if not tasks[tostring(pid)] then
|
||||||
return false, "Task does not exist"
|
return false, "Task does not exist"
|
||||||
|
|
||||||
elseif not isEqualToAny(tasks[tostring(pid)].pid, table.unpack(children)) and kernel.uid ~= 0 then
|
|
||||||
return false, "You do not own this task"
|
|
||||||
|
|
||||||
elseif tasks[tostring(pid)].status ~= "T" then
|
elseif tasks[tostring(pid)].status ~= "T" then
|
||||||
return false, "Task is not stopped"
|
return false, "Task is not stopped"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user