On Wed, 5 May 2004, Andrew - Supernews wrote:
> >> Good plan. I'm not sure what the reasons are for closing the fds
> >> (getting rid of a terminal!?), but I'll leave that to Philip. The
> >> problem is big, since a lot of code is now linked into exim that may
> >> sputter to fds 1/2 under some circumstances ...
Yes, you have to get rid of the terminal. Also, I was much more of a
Unix virgin when I started this. I probably thought "unwanted file
descriptors; better close them to be tidy". I didn't think that library
software would assume it had stderr available - I *still* think any
library software that makes that assumption is broken (unless of course
the specification of its functions says "writes to stderr", but really
any writing function should take a file descriptor argument).
> There seem to be two main places to fix - daemon_go() in daemon.c, and
> close_unwanted() in exim.c.
What are you suggesting? That file descriptors 0, 1, and 2 should be
opened to /dev/null at all times?
Philip
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book: http://www.uit.co.uk/exim-book