From 74eb75f0e73a463b659919aa16dad5bcbbc6ce6a Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Sun, 20 Apr 2025 16:50:45 +0200 Subject: [PATCH] Fix EACCES check. --- src/procmgr.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/procmgr.rs b/src/procmgr.rs index 732df8c1bf..b25ab0a2ff 100644 --- a/src/procmgr.rs +++ b/src/procmgr.rs @@ -1140,8 +1140,9 @@ impl<'a> ProcScheme<'a> { return Err(Error::new(EPERM)); } - // After execv(), i.e. ProcCall::DisableSetpgid, setpgid shall return EACCESS - if proc.disabled_setpgid { + // After execv(), i.e. ProcCall::DisableSetpgid, setpgid where target_pid is a child + // process of the calling process, shall return EACCESS. + if proc.ppid == caller_pid && proc.disabled_setpgid { return Err(Error::new(EACCES)); }