Pass P_SUGID on to the child of a fork(). It was possible to get rlogin

to coredump previously since it (somewhat uniquely) is setuid and forks
without execing, and thus without passing P_SUGID the child could
coredump and possibly divulge sensitive information (such as encrypted
passwords from the passwd database).
This commit is contained in:
David Greenman 1997-02-17 10:58:46 +00:00
parent 2731fd39ed
commit 70e534e78f

View File

@ -275,6 +275,10 @@ fork1(p1, flags, retval)
p2->p_limit->p_refcnt++;
}
/*
* Preserve some flags in subprocess.
*/
p2->p_flag |= p1->p_flag & P_SUGID;
if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT)
p2->p_flag |= P_CONTROLT;
if (flags & RFPPWAIT)