From fa8314227c51816057f11e1672444bbae7baed35 Mon Sep 17 00:00:00 2001 From: knu Date: Mon, 7 May 2001 18:07:29 +0000 Subject: Properly copy the P_ALTSTACK flag in struct proc::p_flag to the child process on fork(2). It is the supposed behavior stated in the manpage of sigaction(2), and Solaris, NetBSD and FreeBSD 3-STABLE correctly do so. The previous fix against libc_r/uthread/uthread_fork.c fixed the problem only for the programs linked with libc_r, so back it out and fix fork(2) itself to help those not linked with libc_r as well. PR: kern/26705 Submitted by: KUROSAWA Takahiro Tested by: knu, GOTOU Yuuzou , and some other people Not objected by: hackers MFC in: 3 days --- sys/kern/kern_fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern/kern_fork.c') diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index c9539bb..d3b991d 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -495,7 +495,7 @@ again: * Preserve some more flags in subprocess. PS_PROFIL has already * been preserved. */ - p2->p_flag |= p1->p_flag & P_SUGID; + p2->p_flag |= p1->p_flag & (P_SUGID | P_ALTSTACK); if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT) p2->p_flag |= P_CONTROLT; if (flags & RFPPWAIT) -- cgit v1.1