Package: dash / 0.5.10.2-5

Metadata

Package Version Patches format
dash 0.5.10.2-5 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 SHELL print n upon EOF CTRL D when run interactively.diff | (download)

src/main.c | 9 8 + 1 - 0 !
1 file changed, 8 insertions(+), 1 deletion(-)

 [patch] main: print \n upon eof (ctrl-d) when run interactively

Exiting dash via a ^D instead of with "exit" causes dash to forget to
print a newline.

    sh-3.1$ sh
    sh-3.1$ ^D
    sh-3.1$ dash
    $ sh-3.1$

It is more neat and tidy to send a newline similarly to what bash does,
so it doesn't make the next prompt of the parent shell look ugly.

Suggested by jidanni.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
[reworded the patch description]
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Bug-Debian: http://bugs.debian.org/476422
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0004 SHELL Disable sh c command sh c exec command optimiza.diff | (download)

src/main.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 4/6] [shell] disable sh -c "command" -> sh -c "exec command"
 optimization

Bugs #642706 (bin-prot FTBFS) and #642835 (sexplib310 FTBFS) can be
fixed by reverting the patch submitted at [1]. I don't understand why.

[1] http://thread.gmane.org/gmane.comp.shells.dash/556

While investigating #642706, in the failing case, I observed that a
cpp process called with "sh -c" gets SIGPIPE while writing to
stderr. In the succeeding case, the write is successful, and is read
by the ocamlbuild process that started "sh -c cpp ...".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

0005 jobs Replace some uses of fmtstr with stpcpy stpncpy.patch | (download)

src/jobs.c | 15 7 + 8 - 0 !
1 file changed, 7 insertions(+), 8 deletions(-)

 [patch] jobs: replace some uses of fmtstr with stpcpy/stpncpy

Some uses of fmtstr, particularly the ones without a format string,
can be replaced with stpcpy or stpncpy.  This patch does that so
we don't have to introduce unnecessary format strings in order to
silence compiler warnings.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0006 EVAL Report I O error on stdout.diff | (download)

src/eval.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch] eval: report i/o error on stdout

ENOSPC as a result of an echo builting failing gives no diagnostic.
Just as other shells, dash sets $? to 1, but aside from terminating
the script, this does not inform the user what the problem is:

zsh:
    % echo foo > /dev/full
    echo: write error: no space left on device

bash:
    $ echo foo > /dev/full
    bash: echo: write error: No space left on device

dash:
    $ echo foo > /dev/full
    [nothing]

Print an error to stderr like the other shells.

Suggested by Roger Leigh.

Signed-off-by: Gerrit Pape <pape@smarden.org>
[reworded the patch description with information from the bug]
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Bug-Debian: http://bugs.debian.org/690473
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0007 Don t execute binary files if execve returned ENOEXE.diff | (download)

src/exec.c | 32 32 + 0 - 0 !
1 file changed, 32 insertions(+)

 [patch 1/2] don't execute binary files if execve() returned enoexec.

Both "dash -c foo" and "./foo" are supposed to be able to run hashbang-less
scripts, but attempts to execute common binary files tend to be nasty:
especially both ELF and PE tend to make dash create a bunch of files with
unprintable names, that in turn confuse some tools up to causing data loss.

Thus, let's read the first line and see if it looks like text.  This is a
variant of the approach used by bash and zsh; mksh instead checks for
signatures of a bunch of common file types.

POSIX says: "If the executable file is not a text file, the shell may bypass
this command execution.".

Signed-off-by: Adam Borowski <kilobyte@angband.pl>

0008 Support e in echo and printf builtins.diff | (download)

src/bltin/printf.c | 1 1 + 0 - 0 !
src/dash.1 | 4 4 + 0 - 0 !
2 files changed, 5 insertions(+)

 [patch 2/2] support \e in "echo" and "printf" builtins.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>

0010 Hardcode mktemp.diff | (download)

src/mkbuiltins | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch] builtin: default to mktemp, not tempfile

Don't use tempfile, as it currently runs tempnam(), which is insecure
and fails under pseudo(1).

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0011 Avoid crash when redirecting to file descriptor in e.diff | (download)

src/eval.c | 3 3 + 0 - 0 !
1 file changed, 3 insertions(+)

 avoid crash when redirecting to file descriptor in expredir.

https://bugs.debian.org/861354

0012 enable large file support when available.patch | (download)

configure.ac | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch] enable large file support when available


9001 Add privmode Part 1.diff | (download)

src/dash.1 | 16 10 + 6 - 0 !
src/main.c | 17 17 + 0 - 0 !
src/options.c | 2 2 + 0 - 0 !
src/options.h | 7 4 + 3 - 0 !
src/var.c | 29 23 + 6 - 0 !
src/var.h | 1 1 + 0 - 0 !
6 files changed, 57 insertions(+), 15 deletions(-)

 implement privmode, part 1
9002 Add privmode Part 2.diff | (download)

src/Makefile.am | 2 1 + 1 - 0 !
src/Makefile.in | 7 4 + 3 - 0 !
src/dash.1 | 2 1 + 1 - 0 !
src/main.c | 14 1 + 13 - 0 !
src/options.c | 4 3 + 1 - 0 !
src/priv.c | 27 27 + 0 - 0 !
src/priv.h | 6 6 + 0 - 0 !
src/var.c | 3 0 + 3 - 0 !
8 files changed, 43 insertions(+), 22 deletions(-)

 implement privmode, part 2