Re: [Exim] TMPDIR env variable

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Kirill Miazine
CC: J. Nick Koston, Exim List
Subject: Re: [Exim] TMPDIR env variable
On Fri, 11 Jul 2003, Kirill Miazine wrote:

> How do you start Exim? As root? Well, maybe root's $TMPDIR is /root/tmp?
> I prefer to start daemons with the environment where only $PATH is set.
> That way one can avoid various surprises.


That's true, but there are other ways of starting Exim. For instance,
when an MUA sends a message it starts an Exim process.

> J. Nick Koston wrote:
> > exim really needs to make set this to a sane value on startup. On
> > mandrake 9.0 it is set to /root/tmp when so exim can never open its
> > wait/retry db files since dbm can never generate a tmp file.


Libraries that rely on settings of environment variables are a disaster
waiting to happen. I note that the C standard says "The implementation
shall behave as if no library function calls the getenv function." But
of course, that applies only to the C library...

Apart from looking at the current value of $TZ (to see if it needs to
fix it - see below), Exim itself does not make any use of the
environment.

How widely used is $TMPDIR? Which OS make use of it?

Some time ago, I tried to remove the entire environment on entry to
Exim. This failed, because on some operating systems, the value of $TZ
is required in order to get the right time stamps, and various other
values may be needed in libraries that are called by Exim.

Current releases of Exim leave the environment alone, except that $TZ is
modified if necessary to make it agree with the "timezone" option. Most
of the time this shouldn't be necessary, which is a good thing because
it has to be done by making a new copy of the environment.

--
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