Package: dash / 0.5.10.2-6

Metadata

Package Version Patches format
dash 0.5.10.2-6 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>

0009 dash Fix stack overflow from infinite recursion in s.patch | (download)

src/eval.c | 8 7 + 1 - 0 !
src/eval.h | 2 2 + 0 - 0 !
2 files changed, 9 insertions(+), 1 deletion(-)

 [patch] dash: fix stack overflow from infinite recursion in script

Bug-Debian: https://bugs.debian.org/579815
Signed-off-by: Chris Lamb <lamby@debian.org>
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>

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


0013 enable hardening for helpers.patch | (download)

src/Makefile.am | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 add $(cppflags), $(cflags) and $(ldflags) to $(compile_for_build) so that helpers are built with hardening


0014 shell Don t include config.h for native helpers.patch | (download)

src/Makefile.am | 3 1 + 2 - 0 !
1 file changed, 1 insertion(+), 2 deletions(-)

 [patch] shell: don't include config.h for native helpers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

config.h contains settings for the cross compiler (most importantly
32/64bit versions of functions), so don't include it when calling the
native compiler to build the helpers.

Otherwise we get build errors like:

/usr/bin/gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN  -g -O2 -Wall    -o mkinit mkinit.c
In file included from /usr/include/sys/stat.h:107,
                 from /usr/include/fcntl.h:38,
                 from mkinit.c:50:
/usr/include/bits/stat.h:117: error: redefinition of ‘struct stat’
In file included from /usr/include/fcntl.h:38,
                 from mkinit.c:50:
/usr/include/sys/stat.h:504: error: redefinition of ‘stat’
/usr/include/sys/stat.h:455: note: previous definition of ‘stat’ was here

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[baruch: apply to Makefile.am; update Peter's email address]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0015 system Disable glibc warning on sigsetmask.patch | (download)

src/system.h | 11 10 + 1 - 0 !
1 file changed, 10 insertions(+), 1 deletion(-)

 [patch] system: disable glibc warning on sigsetmask

As sigsetmask is set as deprecated in glibc this patch adds the
pragmas to disable the warning in gcc around our one and only use
of sigsetmask.

It also disables it completely for non-gcc compilers and older
gcc compilers as they may generate a warning too.

Reported-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0016 options Do not set commandname in procargs.patch | (download)

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

 [patch] options: do not set commandname in procargs

We set commandname in procargs when we don't have to.  This results
in a duplicated output of arg0 when an error occurs.

Reported-by: Olivier Duclos <ods@fastmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

0017 histedit Fix infinite loop when using fc s.patch | (download)

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

 histedit: fix infinite loop when using 'fc -s'
Date: Sat, 27 Apr 2019 22:46:34 +0900 (JST)

When compiling with libedit, he.num may somehow overrun last, causing
an infinite loop when using fc -s.
This mild change to the check plugs it.

Bug-Debian: https://bugs.debian.org/928072


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