summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc/pgrp.c20
1 files 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)
{