Subject: Re: IFS (was: Help on dumping mail)

From: [email-masked] (Stephen R. van den Berg)
Date: Fri, 10 Dec 1993 14:03:45 +0100

Eric Black <[email-masked]> wrote:
>idiom on Unix.  Things like procmail which are expected to be run by
>privileged users from time to time like to have a clean environment,
>including the IFS setting.  This is why procmail trashes nearly all of
>the environment variables it finds itself burdened with when it starts up.

Well, yes and no.  Procmail indeed thrashes the environment to prevent
surprises (read security holes).  Procmail also thrashes the environment
to protect the innocent (on some older sendmails, the whole environment
of the sender would otherwise be available to the recipient (if both
are local)).

The IFS=' ' in the .forward file is not directly related to procmail
however.  Procmail itself couldn't care less about the state of the
IFS variable (it thrashes it in *any* case, to prevent surprises).

The IFS setting in the .forward file is needed on those systems that indeed
propagate the environment of the sender.  If the sender would be malicious,
and would set IFS='/', then bad things can happen (like executing a program
named "local" under the recipient's id by searching the PATH).
So, it is only there for the benefit of the Bourne shell that has to
start up procmail.

The newer sendmails already clear the environment, so this is not needed
in those cases.

Also, as I recently realised, in the aliases file, this is superfluous in
any case, since the shell will still execute under the sender's id, even
if the IFS is wrong.

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).

"Always look on the bright side of life!"