apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Travis <jtra...@covalent.net>
Subject Re: Unix missing fd 0..2, Win32 service missing stdin/out/err handles
Date Sun, 14 Apr 2002 17:13:34 GMT
On Sun, Apr 14, 2002 at 01:38:25PM +0200, Sascha Schumann wrote:
> > As I described, it would be possible for a user to close those
> > descriptors before doing something like say, opening an SDBM.  If
> > they then try to _write_ to those (via something like write() to
> > stderr), then that is a programming error which we should not be
> > trying to solve.
>     Not necessarily.  The daemon might use a third-party library
>     which writes diagnostic messages to stderr (something like
>     Oracle's libs).  Or even worse, the user might be running the
>     application on FreeBSD where malloc(3) writes messages to
>     stderr, if configured to do so.  There are probably more
>     cases where this can happen which the app's author cannot
>     influence.  Supplying module authors with a function which
>     addresses this issue makes sense from that perspective.

If a user knows that a third-party library (Oracle, whatever) can
provide messages to stderr, and they knowingly close that file
descriptor without dup()ing it elsewhere, then that is a bug in
their software.  Having APR open a bunch of file-descriptors so
that this fixes a potential problem (IMO bug in their software)
is just wasting file descriptors.

-- Jon

View raw message