Debian Bug report logs - #548687
dash: Stop on error when reading directory as script

version graph

Package: dash; Maintainer for dash is Andrej Shadura <[email protected]>; Source for dash is src:dash (PTS, buildd, popcon).

Reported by: Jari Aalto <[email protected]>

Date: Mon, 28 Sep 2009 06:54:02 UTC

Severity: wishlist

Tags: patch

Found in versions dash/0.5.6.1-1~exp1, dash/0.5.5.1-3, dash/0.5.7-1

Fixed in version dash/0.5.5.1-4

Forwarded to http://thread.gmane.org/gmane.comp.shells.dash/390/focus=391

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#548687; Package dash. (Mon, 28 Sep 2009 06:54:04 GMT) (full text, mbox, link).


Acknowledgement sent to Jari Aalto <[email protected]>:
New Bug report received and forwarded. Copy sent to Gerrit Pape <[email protected]>. (Mon, 28 Sep 2009 06:54:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Jari Aalto <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dash: Stop on error when reading directory as script
Date: Mon, 28 Sep 2009 09:48:52 +0300
Package: dash
Version: 0.5.5.1-3
Severity: normal


    mkdir tmp
    dash tmp/

    => No error messages, not status code $? to signify error.

Please signal an error and terminate on non-zero exit code (like Bash).

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dash depends on:
ii  debianutils                   3.2.1      Miscellaneous utilities specific t
ii  dpkg                          1.15.4     Debian package management system
ii  libc6                         2.9-25     GNU C Library: Shared libraries

dash recommends no packages.

dash suggests no packages.

-- debconf information excluded




Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#548687; Package dash. (Sun, 04 Oct 2009 11:36:06 GMT) (full text, mbox, link).


Acknowledgement sent to Jari Aalto <[email protected]>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Sun, 04 Oct 2009 11:36:06 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Jari Aalto <[email protected]>
To: [email protected]
Subject: Re: dash: Stop on error when reading directory as script
Date: Sun, 04 Oct 2009 14:31:05 +0300
To sunstantiate this error, here are the relevant POSXI/Susv excerpts.


The shell scripts are executed in context of <file>. The POSIX standard
reads that the context is to be readabale in order to run the
instructions.

(1)

    http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

    2. Shell Command Language
    This chapter contains the definition of the Shell Command Language.

>>  1. The shell reads its input from a file (see sh), from the -c
    option or from the system() and popen() functions defined in the
    System Interfaces volume of IEEE Std 1003.1-2001. If the first line
>>  of a file of shell commands starts with the characters "#!", the
    results are unspecified.

(2)

    http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html

    NAME

    sh - shell, the standard command language interpreter

    SYNOPSIS

    sh [-abCefhimnuvx][-o option][+abCefhimnuvx][+o option]
>>         [command_file [argument...]]

    DESCRIPTION

    The sh utility is a command language interpreter that shall execute
    commands read from a command line string, the standard input, or a
>>  specified file. The application shall ensure that the commands to be
    executed are expressed in the language described in Shell Command
    Language.

(3)

Based on these points it can be concluded that it's an error by
definition to not be able to "read a file" given as an ARG for a shell
to execute. Compare to situation

    type sh
    /bin/dash

    touch file
    chmod 000 file
    sh file
    echo $?
    127

So this context, should behave similarly:

    rm file
    mkdir file
    sh file
    => should print an error




Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#548687; Package dash. (Mon, 05 Oct 2009 08:45:03 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Mon, 05 Oct 2009 08:45:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Gerrit Pape <[email protected]>
To: Jari Aalto <[email protected]>, [email protected]
Cc: [email protected]
Subject: Re: Bug#548687: dash: Stop on error when reading directory as script
Date: Mon, 5 Oct 2009 08:32:48 +0000
tags 548687 + patch
forwarded 548687 upstream
quit

On Sun, Oct 04, 2009 at 02:31:05PM +0300, Jari Aalto wrote:
> To sunstantiate this error, here are the relevant POSXI/Susv excerpts.

FYI,
 http://article.gmane.org/gmane.comp.shells.dash/199

Regards, Gerrit.




Added tag(s) patch. Request was from Gerrit Pape <[email protected]> to [email protected]. (Mon, 05 Oct 2009 08:45:07 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'upstream'. Request was from Gerrit Pape <[email protected]> to [email protected]. (Mon, 05 Oct 2009 08:45:08 GMT) (full text, mbox, link).


Added tag(s) pending. Request was from Gerrit Pape <[email protected]> to [email protected]. (Tue, 13 Apr 2010 11:51:17 GMT) (full text, mbox, link).


Reply sent to Gerrit Pape <[email protected]>:
You have taken responsibility. (Tue, 11 May 2010 10:21:11 GMT) (full text, mbox, link).


Notification sent to Jari Aalto <[email protected]>:
Bug acknowledged by developer. (Tue, 11 May 2010 10:21:12 GMT) (full text, mbox, link).


Message #26 received at [email protected] (full text, mbox, reply):

From: Gerrit Pape <[email protected]>
To: [email protected]
Subject: Bug#548687: fixed in dash 0.5.5.1-4
Date: Tue, 11 May 2010 10:17:07 +0000
Source: dash
Source-Version: 0.5.5.1-4

We believe that the bug you reported is fixed in the latest version of
dash, which is due to be installed in the Debian FTP archive:

ash_0.5.5.1-4_all.deb
  to main/d/dash/ash_0.5.5.1-4_all.deb
dash_0.5.5.1-4.diff.gz
  to main/d/dash/dash_0.5.5.1-4.diff.gz
dash_0.5.5.1-4.dsc
  to main/d/dash/dash_0.5.5.1-4.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gerrit Pape <[email protected]> (supplier of updated dash package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 10 May 2010 23:12:45 +0000
Source: dash
Binary: dash ash
Architecture: all source
Version: 0.5.5.1-4
Distribution: unstable
Urgency: low
Maintainer: Gerrit Pape <[email protected]>
Changed-By: Gerrit Pape <[email protected]>
Description: 
 ash        - compatibility package for dash
 dash       - POSIX-compliant shell
Closes: 429251 514863 540685 548493 548687 548743 557755 562836 564483 577156 577506 578104 579543
Changes: 
 dash (0.5.5.1-4) unstable; urgency=low
 .
   * debian/diff/0002--SHELL-print-n-upon-EOF-CTRL-D-when-run-...diff:
     rename to 0023-*.diff.
   * debian/diff/0001--MAN-rename-sh-to-dash-update-DESCRIPTION-...diff:
     remove; applied upstream.
   * debian/diff/0001-*...0022-*.diff: new from upstream git.
     * debian/diff/0010-*.diff: Add preliminary LINENO support (closes:
       #540685).
     * debian/diff/0017-*.diff: Fix syntax array size (closes: #548493).
     * debian/diff/0009-*.diff: Honor tab as IFS whitespace when
       splitting fields in readcmd (closes: #429251).
   * debian/diff/0024-INPUT-exit-127-if-command_file-is-given-...diff:
     new; exit 127 if command_file is given but does not exist (closes:
     #548743).
   * debian/diff/0025-INPUT-exit-127-if-command_file-is-given-...diff:
     new; exit 127 if command_file is given but is a directory (closes:
     #548687).
   * debian/diff/0026-EVAL-with-set-e-exit-the-shell-if-a-...diff: new;
     with set -e exit the shell if a subshell exits non-zero (closes:
     #514863).
   * debian/diff/0027-EVAL-don-t-clear-eflag-when-forking-subshell.diff:
     new; don't clear eflag when forking subshell (closes: #514863).
   * debian/po/ja.po: [INTL:ja] Update po-debconf template translation
     (thx Hideki Yamane; closes: #564483).
   * debian/po/bg.po: [I18N:bg] Updated Bulgarian debconf translation
     (thx Damyan Ivanov; closes: #562836).
   * debian/dash.preinst: remove superfluous code (closes: #557755).
   * debian/control: Standards-Version: 3.8.4.0.
   * debian/po/vi.po: [INTL:vi] Vietnamese debconf templates translation
     update (thx Clytie Siddall; closes: #577156).
   * debian/po/eu.po: [l10n:eu] dash 0.5.5.1-3.1: updated Basque
     translation (thx dooteo; closes: #577506).
   * debian/po/pt.po: [INTL:pt] Updated Portuguese translation for
     debconf messages (thx Traduz - Portuguese Translation Team; closes:
     #578104).
   * debian/diff/0028-EVAL-Fix-command-crash.diff: new; Fix command --
     crash (closes: #579543).
 .
   [ Raphael Geissert ]
   * Document "/bin/sh -> dash" NMU changes
   * Pass package name to dpkg-divert when removing diversion
   * Simplify prerm by making dpkg-divert do most of the work
   * Pass --package name to dpkg-divert call to replace ash's diversion
   * Quoting style changes
   * Let the postinst script abort if there was already a diversion in
     place
   * Pass --package name to dpkg-divert call to remove ash's diversion
   * Add watch file
Checksums-Sha1: 
 73536f032073d4e5ed70a8b2929ea14dc2be224d 1027 dash_0.5.5.1-4.dsc
 b659a223f62b47e570af31c619e5fb1d314b3156 53246 dash_0.5.5.1-4.diff.gz
 bcce90d6e317cfff8be44aed6d92cbf648a25fd6 24658 ash_0.5.5.1-4_all.deb
Checksums-Sha256: 
 67bb153760f41609fdceb49669344de14e9d3139d693fa82233019d68a2f1711 1027 dash_0.5.5.1-4.dsc
 9bd9741b3bb5a9d1ca8ded2c55302b6a0b59f8c5a5de244be1222abe25b5cac7 53246 dash_0.5.5.1-4.diff.gz
 78e52d21d3dfce2819734019a4c181e578b95da86ecee1d1b7a1602e3c120166 24658 ash_0.5.5.1-4_all.deb
Files: 
 3336479b3e18a7e907054eb7380f8598 1027 shells optional dash_0.5.5.1-4.dsc
 af2d759797a4c0ade6dedefd0b8d21df 53246 shells optional dash_0.5.5.1-4.diff.gz
 74b6098dfac5d6335a578b4c68241581 24658 shells optional ash_0.5.5.1-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvomUQACgkQGJoyQbxwpv+JKgCfRVeEXJ+5Vedd++1k8mDFDMHw
AokAn2D81+hKTtiH0Qiu6ul60Hbk+HNU
=v3ez
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Fri, 11 Jun 2010 07:37:35 GMT) (full text, mbox, link).


Bug unarchived. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Wed, 09 Mar 2011 20:45:10 GMT) (full text, mbox, link).


Bug Marked as found in versions dash/0.5.6.1-1~exp1 and reopened. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Wed, 09 Mar 2011 20:45:10 GMT) (full text, mbox, link).


Severity set to 'wishlist' from 'normal' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Wed, 09 Mar 2011 20:45:11 GMT) (full text, mbox, link).


Changed Bug forwarded-to-address to 'http://thread.gmane.org/gmane.comp.shells.dash/390/focus=391' from 'upstream' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Wed, 09 Mar 2011 20:45:11 GMT) (full text, mbox, link).


Bug Marked as found in versions dash/0.5.7-1. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 27 Sep 2011 01:18:19 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 13:25:03 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.