[exim-dev] [Bug 968] New: Programs run due by pipe transport…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Andreas Metzler
Datum:  
To: exim-dev
Neue Treads: [exim-dev] [Bug 968] Programs run due by pipe transport get SIGPIPE set to IGN, [exim-dev] [Bug 968] Programs run due by pipe transport get SIGPIPE set to IGN, [exim-dev] [Bug 968] Programs run due by pipe transport get SIGPIPE set to IGN, [exim-dev] [Bug 968] Programs run due by pipe transport get SIGPIPE set to IGN, [exim-dev] [Bug 968] Programs run due by pipe transport get SIGPIPE set to IGN
Betreff: [exim-dev] [Bug 968] New: Programs run due by pipe transport get SIGPIPE set to IGN
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=968
           Summary: Programs run due by pipe transport get SIGPIPE set to
                    IGN
           Product: Exim
           Version: 4.71
          Platform: Other
               URL: http://bugs.debian.org/573779
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Transports
        AssignedTo: nigel@???
        ReportedBy: eximusers@???
                CC: exim-dev@???



Hello,

this is http://bugs.debian.org/573779, submitted by Ian Jackson.

-----------------------------------------------------------------
I set up a test program, piping into the following perl script:

$ cat junk/t.pl
#!/usr/bin/perl
print STDERR "Signal handling for SIGPIPE: $SIG{PIPE}.\n";
die;
$

When I tested this by putting
|/home/ian/junk/t.pl
in .forward and sending an email, the expected bounce contained the
following text:

The following text was generated during the delivery attempt:

  ------ pipe to |/home/ian/junk/t.pl
         generated by ian@??? ------


Signal handling for SIGPIPE: IGNORE.
Died at /home/ian/junk/t.pl line 3.

On UN*X all programs are entitled to assume that they inherit SIGPIPE
(and most other signals) set to SIG_DFL. Programs with careful error
handling can fail when SIGPIPE is set to SIG_IGN, because it causes
programs such as "cat" to do this:

$ sh -xc 'trap "" PIPE; (sleep 1; echo hi) | cat | true; echo
${PIPESTATUS[*]}'
+ trap '' PIPE
+ sleep 1
+ cat
+ true
+ echo hi
cat: write error: Broken pipe
+ echo 0 1 0
0 1 0
$

Rather than this:

$ sh -xc '(sleep 1; echo hi) | cat | true; echo ${PIPESTATUS[*]}'
+ sleep 1
+ cat
+ true
+ echo hi
+ echo 0 141 0
0 141 0
$

Ian.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email