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