Commit c59edc98 authored by Méven Car's avatar Méven Car Committed by David Edmundson
Browse files

TaskManager: Restrict parents process to those sharing the same cgroup

BUG: 417457
parent 6925dd2f
......@@ -563,7 +563,24 @@ qint64 Backend::parentPid(qint64 pid) const
return -1;
}
return proc->parentPid();
int parentPid = proc->parentPid();
if (parentPid != -1) {
KSysGuard::Process *parentProc = procs.getProcess(parentPid);
if (!parentProc) {
// make sure the parent process details are loaded
procs.updateAllProcesses();
parentProc = procs.getProcess(parentPid);
}
if (!parentProc) {
return -1;
}
if (!proc->cGroup().isEmpty() && parentProc->cGroup() == proc->cGroup()) {
return parentProc->pid();
}
}
return -1;
}
void Backend::windowsHovered(const QVariant &_winIds, bool hovered)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment