Your message dated Thu, 18 Aug 2005 13:05:10 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Bug#320036: bash exits 0 on errors reading stdin (and perhaps 
other scripts) (forwarded from Ian Jackson)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Jul 2005 15:34:58 +0000
>From [EMAIL PROTECTED] Tue Jul 26 08:34:58 2005
Return-path: <[EMAIL PROTECTED]>
Received: from chiark.greenend.org.uk [193.201.200.170] (mail)
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1DxRSL-0000Nq-00; Tue, 26 Jul 2005 08:34:57 -0700
Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local
        (return-path [EMAIL PROTECTED])
        id 1DxRSK-0007aC-00
        for [EMAIL PROTECTED]; Tue, 26 Jul 2005 16:34:56 +0100
From: Ian Jackson <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <[EMAIL PROTECTED]>
Date: Tue, 26 Jul 2005 16:34:56 +0100
To: [EMAIL PROTECTED]
Subject: bash exits 0 on errors reading stdin (and perhaps other scripts)
X-Mailer: VM 7.03 under Emacs 19.34.1
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: bash
Version: 2.05a-11
Severity: grave

chiark:~> bash 0>/dev/null
chiark:~> echo $?
0
chiark:~> strace bash 0>/dev/null 2>&1 | egrep '^read\(0|^_?exit'
read(0, 0x80cadb0, 1)                   = -1 EBADF (Bad file descriptor)
_exit(0)                                = ?
chiark:~> dpkg -s bash
Package: bash
Essential: yes
Status: install ok installed
Priority: required
Section: base
Installed-Size: 872
Maintainer: Matthias Klose <[EMAIL PROTECTED]>
Version: 2.05a-11
Replaces: bash-doc (<= 2.05-1), bash-completion
Depends: base-files (>= 2.1.12)
Pre-Depends: libc6 (>= 2.2.4-4), libncurses5 (>= 5.2.20020112a-1)
Conflicts: bash-completion
Conffiles:
 /etc/bash.bashrc e218a2979b01db4e9c3ae19c94294a57
 /etc/bash_completion 5769c2f29cbbc0bde1cf2996ec6231ec
 /etc/skel/.bash_profile d8e9ecd0b80102c82966a045544bbf68
 /etc/skel/.bashrc e9d2739d6f3d7672222c07d901d46e21
Description: The GNU Bourne Again SHell
 Bash is an sh-compatible command language interpreter that executes
 commands read from the standard input or from a file.  Bash also
 incorporates useful features from the Korn and C shells (ksh and csh).
 .
 Bash is ultimately intended to be a conformant implementation of the
 IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).

chiark:~> type bash
bash is hashed (/bin/bash)
chiark:~>

I have also reproduced this with bash 2.05b-2-26, and in the latter
case managed to prove to myself that it does the same with EIO.

This lack of proper error handling might easily cause data loss, as a
script might exit 0 when it hasn't done its work.

Ian.

---------------------------------------
Received: (at 320036-done) by bugs.debian.org; 18 Aug 2005 11:05:20 +0000
>From [EMAIL PROTECTED] Thu Aug 18 04:05:20 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1E5iD1-0000Ym-00; Thu, 18 Aug 2005 04:05:19 -0700
Received: from mailhost.cs.tu-berlin.de ([EMAIL PROTECTED] [130.149.17.13])
        by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id NAA24071;
        Thu, 18 Aug 2005 13:05:17 +0200 (MEST)
Received: from localhost (localhost [127.0.0.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id C1381FD4F;
        Thu, 18 Aug 2005 13:05:16 +0200 (MEST)
Received: from mailhost.cs.tu-berlin.de ([127.0.0.1])
 by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP
 id 29603-48; Thu, 18 Aug 2005 13:05:10 +0200 (MEST) 11337
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP;
        Thu, 18 Aug 2005 13:05:10 +0200 (MEST)
Received: (from [EMAIL PROTECTED])
        by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id j7IB5A3u023883;
        Thu, 18 Aug 2005 13:05:10 +0200 (MEST)
From: Matthias Klose <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 18 Aug 2005 13:05:10 +0200
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: Ian Jackson <[EMAIL PROTECTED]>
Subject: Re: Bug#320036: bash exits 0 on errors reading stdin (and perhaps 
other scripts) (forwarded from Ian Jackson)
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid
X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

Chet Ramey writes:
> Matthias Klose wrote:
> > 
> > ------------------------------------------------------------------------
> > 
> > Subject:
> > Bug#320036: bash exits 0 on errors reading stdin (and perhaps other scripts)
> 
> No shell behaves as the submitter describes.  Read errors are translated
> to EOF, and the shell exits.  The exit value is $?, which is changed by
> the last command (pipeline) executed or by a signal.

closing the report.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to