From: devet@adv.win.tue.nl (Arjan de Vet)
Subject: WARNING: Elm and bash 1.13.cwru problems + solution
Date: 17 Sep 1993 23:20:52 GMT [thread overview]
Message-ID: <27dgok$7d0@samba.oit.unc.edu> (raw)
Some people have noticed that Elm generates empty mail messages when using
bash 1.13.cwru (beta).
This is an Elm problem that has been fixed in Elm 2.4.22!
Earlier versions of Elm had a bug which does not show up when using bash
1.12 because of a bug in bash 1.12. For the exact details I have included
some correspondence with Chet Ramey, author of bash 1.13.cwru.
Arjan
-----------------------------------------------------------------------------
Chet,
I noticed a problem with my mail. My MUA (elm) calls the MTA
/usr/lib/sendmail (smail) in the following way (I wrote a /bin/sh which
logs
all parameters):
/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; /bin/rm -f
/tmp/snd.03447aaa) & ) < /tmp/snd.03447aaa'
The /tmp/snd.. file contains the body of the mail. When using bash 1.12 the
body gets included in the message, but when using bash 1.13cwru I get an
empty body: the contents of the /tmp/snd.. file does not get read by
sendmail.
Any ideas how this can be solved?
Arjan
-----------------------------------------------------------------------------
Chet's reply:
-----------------------------------------------------------------------------
You wrote:
>I noticed a problem with my mail. My MUA (elm) calls the MTA
>/usr/lib/sendmail (smail) in the following way (I wrote a /bin/sh which
logs
>all parameters):
>
>/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; \
> /bin/rm -f /tmp/snd.03447aaa) & ) < /tmp/snd.03447aaa'
A background job running in a non-job-control environment gets
/dev/null as stdin. Posix specifies this, and qualifies it with the
statement that explicit redirections override this implicit one. The
command to which the `&' is applied has no explicit redirections; the
redirection is applied to the subshell created because of the ( ).
This redirection happens before the shell that runs sendmail and rm is
forked.
Consider the difference between this command:
cat > ./ppp < /etc/printcap &
and this one:
cat > ./ppp & < /etc/printcap
As a consequence of the /dev/null rule, the first results in a copy of
/etc/printcap in ppp, while the second leaves ppp an empty file.
If you change the command elm runs to something like
/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; /bin/rm
-f /tmp
/snd.03447aaa) </tmp/snd.03447aaa & )'
it will probably work.
This is a case where bash is not `bug-for-bug compatible' with sh.
Chet
-----------------------------------------------------------------------------
--
Arjan de Vet <Arjan.de.Vet@adv.win.tue.nl> (home)
Eindhoven University of Technology, the Netherlands <devet@win.tue.nl> (work)
--
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
reply other threads:[~1993-09-17 23:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox