summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-06-14 06:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-06-14 06:15:10 +0000
commit010ec2dbd94db4241418b528dc8662a7ef574069 (patch)
tree62ef4743e56902e05c6fdd154b5deaaef732c4b5
parentReleasing progress-linux version 4.4.18-2~dschinn1. (diff)
downloadbash-010ec2dbd94db4241418b528dc8662a7ef574069.zip
bash-010ec2dbd94db4241418b528dc8662a7ef574069.tar.xz
Merging debian version 4.4.18-3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/changelog17
-rw-r--r--debian/control2
-rw-r--r--debian/patches/bash44-020.diff140
-rw-r--r--debian/patches/bash44-021.diff50
-rw-r--r--debian/patches/bash44-022.diff50
-rw-r--r--debian/patches/bash44-023.diff49
-rw-r--r--debian/patches/series4
7 files changed, 311 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 654c564..4309476 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+bash (4.4.18-3) unstable; urgency=medium
+
+ * Apply upstream patches 020 - 023. Fixing:
+ - In circumstances involving long-running scripts that create and reap many
+ processes, it is possible for the hash table bash uses to store exit
+ statuses from asynchronous processes to develop loops. This patch fixes
+ the loop causes and adds code to detect any future loops.
+ - A SIGINT received inside a SIGINT trap handler can possibly cause the
+ shell to loop.
+ - There are cases where a failing readline command (e.g., delete-char at
+ the end of a line) can cause a multi-character key sequence to `back up'
+ and attempt to re-read some of the characters in the sequence.
+ - When sourcing a file from an interactive shell, setting the SIGINT handler
+ to the default and typing ^C will cause the shell to exit.
+
+ -- Matthias Klose <doko@debian.org> Fri, 01 Jun 2018 21:05:11 +0200
+
bash (4.4.18-2~dschinn1) dschinn-backports; urgency=medium
* Uploading to dschinn-backports, remaining changes:
diff --git a/debian/control b/debian/control
index 8fceb44..3d495fb 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Progress Linux Maintainers <maintainers@lists.progress-linux.org>
XSBC-Uploaders: Daniel Baumann <daniel.baumann@progress-linux.org>
XSBC-Original-Maintainer: Matthias Klose <doko@debian.org>
Bugs: mailto:maintainers@lists.progress-linux.org
-Standards-Version: 4.1.3
+Standards-Version: 4.1.4
Build-Depends: autoconf, autotools-dev, bison, libncurses5-dev,
texinfo, texi2html, debhelper (>= 9.20160115~), gettext, sharutils,
locales <!nocheck>, time <!nocheck>,
diff --git a/debian/patches/bash44-020.diff b/debian/patches/bash44-020.diff
new file mode 100644
index 0000000..32369a3
--- /dev/null
+++ b/debian/patches/bash44-020.diff
@@ -0,0 +1,140 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.4
+Patch-ID: bash44-020
+
+Bug-Reported-by: Graham Northup <northug@clarkson.edu>
+Bug-Reference-ID: <537530c3-61f0-349b-9de6-fa4e2487f428@clarkson.edu>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00025.html
+
+Bug-Description:
+
+In circumstances involving long-running scripts that create and reap many
+processes, it is possible for the hash table bash uses to store exit
+statuses from asynchronous processes to develop loops. This patch fixes
+the loop causes and adds code to detect any future loops.
+
+Index: b/jobs.c
+===================================================================
+--- a/jobs.c
++++ b/jobs.c
+@@ -812,8 +812,22 @@ bgp_add (pid, status)
+ ps_index_t *bucket, psi;
+ struct pidstat *ps;
+
+- bucket = pshash_getbucket (pid);
+- psi = bgp_getindex ();
++ /* bucket == existing chain of pids hashing to same value
++ psi = where were going to put this pid/status */
++
++ bucket = pshash_getbucket (pid); /* index into pidstat_table */
++ psi = bgp_getindex (); /* bgpids.head, index into storage */
++
++ /* XXX - what if psi == *bucket? */
++ if (psi == *bucket)
++ {
++#ifdef DEBUG
++ internal_warning ("hashed pid %d (pid %d) collides with bgpids.head, skipping", psi, pid);
++#endif
++ bgpids.storage[psi].pid = NO_PID; /* make sure */
++ psi = bgp_getindex (); /* skip to next one */
++ }
++
+ ps = &bgpids.storage[psi];
+
+ ps->pid = pid;
+@@ -841,32 +855,47 @@ pshash_delindex (psi)
+ ps_index_t psi;
+ {
+ struct pidstat *ps;
++ ps_index_t *bucket;
+
+ ps = &bgpids.storage[psi];
+ if (ps->pid == NO_PID)
+ return;
+
+- if (ps->bucket_next != NO_PID)
++ if (ps->bucket_next != NO_PIDSTAT)
+ bgpids.storage[ps->bucket_next].bucket_prev = ps->bucket_prev;
+- if (ps->bucket_prev != NO_PID)
++ if (ps->bucket_prev != NO_PIDSTAT)
+ bgpids.storage[ps->bucket_prev].bucket_next = ps->bucket_next;
+ else
+- *(pshash_getbucket (ps->pid)) = ps->bucket_next;
++ {
++ bucket = pshash_getbucket (ps->pid);
++ *bucket = ps->bucket_next; /* deleting chain head in hash table */
++ }
++
++ /* clear out this cell, just in case */
++ ps->pid = NO_PID;
++ ps->bucket_next = ps->bucket_prev = NO_PIDSTAT;
+ }
+
+ static int
+ bgp_delete (pid)
+ pid_t pid;
+ {
+- ps_index_t psi;
++ ps_index_t psi, orig_psi;
+
+ if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0)
+ return 0;
+
+ /* Search chain using hash to find bucket in pidstat_table */
+- for (psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
+- if (bgpids.storage[psi].pid == pid)
+- break;
++ for (orig_psi = psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
++ {
++ if (bgpids.storage[psi].pid == pid)
++ break;
++ if (orig_psi == bgpids.storage[psi].bucket_next) /* catch reported bug */
++ {
++ internal_warning ("bgp_delete: LOOP: psi (%d) == storage[psi].bucket_next", psi);
++ return 0;
++ }
++ }
+
+ if (psi == NO_PIDSTAT)
+ return 0; /* not found */
+@@ -904,15 +933,22 @@ static int
+ bgp_search (pid)
+ pid_t pid;
+ {
+- ps_index_t psi;
++ ps_index_t psi, orig_psi;
+
+ if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0)
+ return -1;
+
+ /* Search chain using hash to find bucket in pidstat_table */
+- for (psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
+- if (bgpids.storage[psi].pid == pid)
+- return (bgpids.storage[psi].status);
++ for (orig_psi = psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
++ {
++ if (bgpids.storage[psi].pid == pid)
++ return (bgpids.storage[psi].status);
++ if (orig_psi == bgpids.storage[psi].bucket_next) /* catch reported bug */
++ {
++ internal_warning ("bgp_search: LOOP: psi (%d) == storage[psi].bucket_next", psi);
++ return -1;
++ }
++ }
+
+ return -1;
+ }
+Index: b/patchlevel.h
+===================================================================
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
+ looks for to find the patch level (for the sccs version string). */
+
+-#define PATCHLEVEL 19
++#define PATCHLEVEL 20
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/debian/patches/bash44-021.diff b/debian/patches/bash44-021.diff
new file mode 100644
index 0000000..76351a9
--- /dev/null
+++ b/debian/patches/bash44-021.diff
@@ -0,0 +1,50 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.4
+Patch-ID: bash44-021
+
+Bug-Reported-by: werner@suse.de
+Bug-Reference-ID: <201803281402.w2SE2VOa000476@noether.suse.de>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2018-03/msg00196.html
+
+Bug-Description:
+
+A SIGINT received inside a SIGINT trap handler can possibly cause the
+shell to loop.
+
+Index: b/jobs.c
+===================================================================
+--- a/jobs.c
++++ b/jobs.c
+@@ -2689,7 +2689,17 @@ wait_for (pid)
+ wait_sigint_received = child_caught_sigint = 0;
+ if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB))
+ {
+- old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
++ SigHandler *temp_sigint_handler;
++
++ temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
++ if (temp_sigint_handler == wait_sigint_handler)
++ {
++#if defined (DEBUG)
++ internal_warning ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
++#endif
++ }
++ else
++ old_sigint_handler = temp_sigint_handler;
+ waiting_for_child = 0;
+ if (old_sigint_handler == SIG_IGN)
+ set_signal_handler (SIGINT, old_sigint_handler);
+Index: b/patchlevel.h
+===================================================================
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
+ looks for to find the patch level (for the sccs version string). */
+
+-#define PATCHLEVEL 20
++#define PATCHLEVEL 21
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/debian/patches/bash44-022.diff b/debian/patches/bash44-022.diff
new file mode 100644
index 0000000..81c86c5
--- /dev/null
+++ b/debian/patches/bash44-022.diff
@@ -0,0 +1,50 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.4
+Patch-ID: bash44-022
+
+Bug-Reported-by: Nuzhna Pomoshch <nuzhna_pomoshch@yahoo.com>
+Bug-Reference-ID: <1317167476.1492079.1495999776464@mail.yahoo.com>
+Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2017-05/msg00005.html
+
+Bug-Description:
+
+There are cases where a failing readline command (e.g., delete-char at the end
+of a line) can cause a multi-character key sequence to `back up' and attempt
+to re-read some of the characters in the sequence.
+
+Index: b/lib/readline/readline.c
+===================================================================
+--- a/lib/readline/readline.c
++++ b/lib/readline/readline.c
+@@ -1057,7 +1057,7 @@ _rl_subseq_result (r, map, key, got_subs
+ /* We probably shadowed a keymap, so keep going. */
+ r = _rl_dispatch (ANYOTHERKEY, m);
+ }
+- else if (r && map[ANYOTHERKEY].function)
++ else if (r < 0 && map[ANYOTHERKEY].function)
+ {
+ /* We didn't match (r is probably -1), so return something to
+ tell the caller that it should try ANYOTHERKEY for an
+@@ -1069,7 +1069,7 @@ _rl_subseq_result (r, map, key, got_subs
+ _rl_dispatching_keymap = map;
+ return -2;
+ }
+- else if (r && got_subseq)
++ else if (r < 0 && got_subseq) /* XXX */
+ {
+ /* OK, back up the chain. */
+ if (RL_ISSTATE (RL_STATE_MACROINPUT))
+Index: b/patchlevel.h
+===================================================================
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
+ looks for to find the patch level (for the sccs version string). */
+
+-#define PATCHLEVEL 21
++#define PATCHLEVEL 22
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/debian/patches/bash44-023.diff b/debian/patches/bash44-023.diff
new file mode 100644
index 0000000..be5ec6c
--- /dev/null
+++ b/debian/patches/bash44-023.diff
@@ -0,0 +1,49 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.4
+Patch-ID: bash44-023
+
+Bug-Reported-by: Martijn Dekker <martijn@inlv.org>
+Bug-Reference-ID: <5326d6b9-2625-1d32-3e6e-ad1d15462c09@inlv.org>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00041.html
+
+Bug-Description:
+
+When sourcing a file from an interactive shell, setting the SIGINT handler
+to the default and typing ^C will cause the shell to exit.
+
+Index: b/builtins/trap.def
+===================================================================
+--- a/builtins/trap.def
++++ b/builtins/trap.def
+@@ -98,6 +98,7 @@ static int display_traps __P((WORD_LIST
+ #define IGNORE 2 /* Ignore this signal. */
+
+ extern int posixly_correct, subshell_environment;
++extern int sourcelevel, running_trap;
+
+ int
+ trap_builtin (list)
+@@ -212,6 +213,9 @@ trap_builtin (list)
+ was SIG_IGN? */
+ if (interactive)
+ set_signal_handler (SIGINT, sigint_sighandler);
++ /* special cases for interactive == 0 */
++ else if (interactive_shell && (sourcelevel||running_trap))
++ set_signal_handler (SIGINT, sigint_sighandler);
+ else
+ set_signal_handler (SIGINT, termsig_sighandler);
+ break;
+Index: b/patchlevel.h
+===================================================================
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
+ looks for to find the patch level (for the sccs version string). */
+
+-#define PATCHLEVEL 22
++#define PATCHLEVEL 23
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/debian/patches/series b/debian/patches/series
index ee570e7..5ff3af8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,9 @@
# bash44-001.diff
bash44-019.diff
+bash44-020.diff
+bash44-021.diff
+bash44-022.diff
+bash44-023.diff
bashbug-editor.diff
deb-bash-config.diff
deb-examples.diff