From 63554c11f5deb5b42f0bcb9143e2c443602fa294 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Sat, 22 Jul 1995 19:09:02 +0000 Subject: (S_proc_setpgrp): Install bletcherous hack. --- proc/pgrp.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/proc/pgrp.c b/proc/pgrp.c index a0231c79..0601bb64 100644 --- a/proc/pgrp.c +++ b/proc/pgrp.c @@ -295,11 +295,21 @@ S_proc_setpgrp (struct proc *callerp, pgid = p->p_pid; pg = pgrp_find (pgid); - if (p->p_pgrp->pg_session->s_sid == p->p_pid - || p->p_pgrp->pg_session != callerp->p_pgrp->pg_session - || ((pgid != p->p_pid - && (!pg || pg->pg_session != callerp->p_pgrp->pg_session)))) - return EPERM; + /* Temporary hack...XXX */ + if (pg || !zombie_check_pid (pgid)) + /* Look to see if this pgid is in use by a zombie; if so, + then don't do the permission check below. This is incorrect; + actually, zombies should be more real than they are now. + But the effect is right to avoid confusing bash in the case I + care about right now. */ + { + + if (p->p_pgrp->pg_session->s_sid == p->p_pid + || p->p_pgrp->pg_session != callerp->p_pgrp->pg_session + || ((pgid != p->p_pid + && (!pg || pg->pg_session != callerp->p_pgrp->pg_session)))) + return EPERM; + } if (p->p_pgrp != pg) { -- cgit v1.2.3