pidref: we never have to verify PID 1
The process exists as long as the kernel/userns exists at all, hence we don't have to verify a pidfd to it.
This commit is contained in:
@@ -250,6 +250,9 @@ int pidref_verify(const PidRef *pidref) {
|
||||
if (!pidref_is_set(pidref))
|
||||
return -ESRCH;
|
||||
|
||||
if (pidref->pid == 1)
|
||||
return 1; /* PID 1 can never go away, hence never be recycled to a different process → return 1 */
|
||||
|
||||
if (pidref->fd < 0)
|
||||
return 0; /* If we don't have a pidfd we cannot validate it, hence we assume it's all OK → return 0 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user