Bash 1.13.cwru and Elm problems

Bash 1.13.cwru and Elm problems

Post by Arjan de V » Sat, 18 Sep 1993 05:42:49






>>        The problem I have is that elm generates mail as it should, resolves
>>        names and aliases properly, but does not transmit the body of the
>>        message. What can it be?

>    As you have discovered, the problem is the new version of bash,
>1.13.1 cwru. Does anyone know why this would break elm?

Yes. Here are some excerpts from correspondence last April with Chet Ramey,
author of bash 1.13.cwru.

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


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

And his reply:

-----------------------------------------------------------------------------


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


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

The fix suggested is present in the latest version of Elm (2.4.22) and
maybe even earlier. So upgrade your Elm. Because of a bug in bash 1.12
this Elm `bug' does not show up when using bash 1.12 as /bin/sh.

Bash 1.13.cwru was not the only shell which had problems with this Elm
`bug'. My report also solved the problem for BSD people using Elm and ash
as /bin/sh.

Arjan

--


 
 
 

1. WARNING: Elm and bash 1.13.cwru problems + solution

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


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

-----------------------------------------------------------------------------

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


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

--


--

2. CSH exit code handling

3. Bash 1.13.cwru (beta) available for Linux

4. Which kernel supports token-ring?

5. WARNING: bash 1.13(beta) and XFree86 don't mix

6. USB zip drive, and MS-DOS (FAT) media

7. Bash 1.13 contains a bug?

8. Welcome to the ZFS Community!

9. BASH BASH BASH BASH BASH BASH BASH BASH BASH BASH

10. Problems with AST_FOURPORT under 1.13

11. REDHAT 5.0 and YARD 1.13 -- problems with PAM.

12. Ftape 1.13/Kernel 1.1.24 problems

13. Problems with AST_FOURPORT under 1.13