Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2002 16:07:42 -0400
From:      Mike Barcroft <mike@FreeBSD.ORG>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        "M. Warner Losh" <imp@village.org>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/kern kern_descrip.c kern_exec.c src/sys/sys filedesc.h
Message-ID:  <20020422160742.B8421@espresso.q9media.com>
In-Reply-To: <200204190420.g3J4KMC69617@khavrinen.lcs.mit.edu>; from wollman@lcs.mit.edu on Fri, Apr 19, 2002 at 12:20:22AM -0400
References:  <200204190045.g3J0jUY59526@freefall.freebsd.org> <200204190309.g3J39tE69057@khavrinen.lcs.mit.edu> <20020418.220125.06947209.imp@village.org> <200204190420.g3J4KMC69617@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
[Sorry for the late reply.]

Garrett Wollman <wollman@lcs.mit.edu> writes:
> <<On Thu, 18 Apr 2002 22:01:25 -0600 (MDT), "M. Warner Losh" <imp@village.org> said:
> 
> > There is no other way to fix this than in the kernel...
> 
> Sure there is -- make sure that every privileged process has something
> on every fd.  You could do it in csu (although from a standards
> perspective that would make no difference).  Or, alternatively, rather
> than changing exec(), you could change fdalloc() to never return fd 0,
> 1, or 2 except when explicitly requested by dup2() -- although this
> would break some seriously old programs that expect to be able to do
> 
> 	fd = open(...)
> 	close(1);
> 	dup(fd);
> 
> and have it work.  (These programs are broken anyway -- the Standard
> does not guarantee any particular order of fd allocation.)

I agree that the current solution to this problem is wrong.  I think
the most correct solution would be to fix each set[ug]id program to
ensure that it has a working set of the basic std{in,out,err}
descriptors by making a series of fstat() calls and watching for a
EBADF.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020422160742.B8421>