From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,6bf0fceadeba484d,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1993-09-17 18:01:08 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!gatech!concert!samba.oit.unc.edu!bounce-bounce From: devet@adv.win.tue.nl (Arjan de Vet) Newsgroups: comp.os.linux.announce Subject: WARNING: Elm and bash 1.13.cwru problems + solution Followup-To: comp.os.linux.misc Date: 17 Sep 1993 23:20:52 GMT Organization: Eindhoven University of Technology, the Netherlands Message-ID: <27dgok$7d0@samba.oit.unc.edu> Reply-To: devet@adv.win.tue.nl (Arjan de Vet) NNTP-Posting-Host: calypso.oit.unc.edu Keywords: elm bash mail bug Originator: mdw@sunSITE 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) (home) Eindhoven University of Technology, the Netherlands (work) -- Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu