From 94fed9b54f0a9769748c8105a7fbd9ea3a4689d18da6923100f52c0707954cfd Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 15 Mar 2013 15:46:33 +0000 Subject: [PATCH 1/2] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=148 --- bash-3.2-longjmp.dif | 6 +++--- bash-4.2-patches.tar.bz2 | 4 ++-- bash.changes | 21 +++++++++++++++++++++ bash.spec | 27 +++++++++++++++++++++++++-- run-tests | 6 +++++- 5 files changed, 56 insertions(+), 8 deletions(-) diff --git a/bash-3.2-longjmp.dif b/bash-3.2-longjmp.dif index 5f19296..ba6e9ad 100644 --- a/bash-3.2-longjmp.dif +++ b/bash-3.2-longjmp.dif @@ -12,19 +12,19 @@ /* We have committed to attempting to execute the contents of this file as shell commands. */ -+#if 1 ++#if defined(BNC382214) && (BNC382214 == 1) + larray = strvec_len(args) + 1; + args = strvec_resize(args, larray + 1); + + for (i = larray - 1; i; i--) + args[i] = args[i - 1]; + -+ args[0] = savestring(_PATH_BSHELL); ++ args[0] = current_user.shell ? current_user.shell : savestring(_PATH_BSHELL); + args[1] = command; + args[larray] = (char *)0; + + SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ -+ execve ("/bin/sh", args, env); ++ execve (args[0], args, env); + SETOSTYPE (1); + + internal_error (_("%s: cannot execute: %s"), command, strerror (errno)); diff --git a/bash-4.2-patches.tar.bz2 b/bash-4.2-patches.tar.bz2 index 6995d9c..434c9f2 100644 --- a/bash-4.2-patches.tar.bz2 +++ b/bash-4.2-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:251f7aa87048b2ad274e6006e234a1d6270bc074cc779308c2117dcf17f73723 -size 25471 +oid sha256:441c0e7f90b24072c6acf50d14da277a5854e7f4446b03b2faae5c4748eb6c5f +size 26485 diff --git a/bash.changes b/bash.changes index 5a28f41..c397851 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Fri Mar 15 15:35:51 UTC 2013 - werner@suse.de + +- Disable workaround for bnc#382214 due bnc#806628, let's see when + the old bug will be up again. +- Update bash 4.2 to patch level 45 + * When SIGCHLD is trapped, and a SIGCHLD trap handler runs when + a pending `read -t' invocation times out and generates SIGALRM, + bash can crash with a segmentation fault. + * When converting a multibyte string to a wide character string + as part of pattern matching, bash does not handle the end of + the string correctly, causing the search for the NUL to go + beyond the end of the string and reference random memory. + Depending on the contents of that memory, bash can produce + errors or crash. + * The <&n- and >&n- redirections, which move one file descriptor + to another, leave the file descriptor closed when applied to + builtins or compound commands. +- Use screen to provide a controlling terminal for running the + test suite + ------------------------------------------------------------------- Tue Feb 12 07:58:08 UTC 2013 - schwab@suse.de diff --git a/bash.spec b/bash.spec index 40826b5..9ed4ebc 100644 --- a/bash.spec +++ b/bash.spec @@ -27,6 +27,7 @@ BuildRequires: fdupes BuildRequires: makeinfo %endif BuildRequires: ncurses-devel +BuildRequires: screen %define bash_vers 4.2 %define rl_vers 6.2 %define extend "" @@ -73,6 +74,7 @@ Patch11: bash-4.0-loadables.dif Patch12: bash-4.1-completion.dif Patch13: bash-4.2-nscdunmap.dif Patch14: bash-4.2-sigrestart.patch +# PATCH-FIX-UPSTREAM bnc#382214 -- disabled due bnc#806628 by -DBNC382214=0 Patch15: bash-3.2-longjmp.dif Patch16: bash-4.0-setlocale.dif Patch17: bash-4.0-headers.dif @@ -329,6 +331,22 @@ done LANG=POSIX LC_ALL=$LANG unset LC_CTYPE + SCREENDIR=$(mktemp -d ${PWD}/screen.XXXXXX) || exit 1 + SCREENRC=${SCREENDIR}/bash + export SCREENRC SCREENDIR + exec 0< /dev/null + SCREENLOG=${SCREENDIR}/log + cat > $SCREENRC<<-EOF + deflogin off + logfile $SCREENLOG + logfile flush 1 + logtstamp off + log on + setsid on + scrollback 0 + silence on + utf8 on + EOF CPU=$(uname -m 2> /dev/null) HOSTTYPE=${CPU} MACHTYPE=${CPU}-suse-linux @@ -387,6 +405,7 @@ pushd ../readline-%{rl_vers}%{extend} cflags -Wno-unused-parameter CFLAGS cflags -ftree-loop-linear CFLAGS cflags -pipe CFLAGS + cflags -DBNC382214=0 CFLAGS cflags -Wl,--as-needed LDFLAGS cflags -Wl,-O2 LDFLAGS cflags -Wl,--hash-size=8599 LDFLAGS @@ -509,9 +528,13 @@ popd --enable-separate-helpfiles=%{_datadir}/bash/helpfiles \ $READLINE make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_generate"} \ - all printenv recho zecho xcase + all printenv recho zecho xcase TMPDIR=$(mktemp -d /tmp/bash.XXXXXXXXXX) || exit 1 - env -i HOME=$PWD TERM=$TERM LD_LIBRARY_PATH=$LD_LIBRARY_PATH TMPDIR=$TMPDIR make TESTSCRIPT=%{SOURCE4} check + > $SCREENLOG + env -i HOME=$PWD TERM=$TERM LD_LIBRARY_PATH=$LD_LIBRARY_PATH TMPDIR=$TMPDIR \ + SCREENRC=$SCREENRC SCREENDIR=$SCREENDIR \ + screen -L -D -m make TESTSCRIPT=%{SOURCE4} check + cat $SCREENLOG make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_feedback" clean} all make -C examples/loadables/ make documentation diff --git a/run-tests b/run-tests index c4a2510..501eccc 100644 --- a/run-tests +++ b/run-tests @@ -20,7 +20,7 @@ echo Any output from any test, unless otherwise noted, indicates a possible anom for x in run-* do case $x in - $0|run-all|run-minimal|run-gprof|run-jobs|run-ifs-posix) ;; + $0|run-all|run-minimal|run-gprof|run-jobs) ;; *.orig|*~) ;; *) echo $x ; sh $x ;; esac @@ -40,4 +40,8 @@ time while ((count-- > 0)) ; do ${THIS_SH} -c $tmp done echo '#########################' +set -x +read -t1 < /dev/tty +set +x +echo '#########################' exit 0 From f7db404702dfd695d604302955ba5344db5b20a64eaf7fea9cd818a90886dedd Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 21 Mar 2013 11:55:05 +0000 Subject: [PATCH 2/2] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=149 --- bash-4.2-patches.tar.bz2 | 4 ++-- bash.changes | 8 ++++++++ bash.spec | 28 ++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/bash-4.2-patches.tar.bz2 b/bash-4.2-patches.tar.bz2 index 434c9f2..f3e3ef0 100644 --- a/bash-4.2-patches.tar.bz2 +++ b/bash-4.2-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:441c0e7f90b24072c6acf50d14da277a5854e7f4446b03b2faae5c4748eb6c5f -size 26485 +oid sha256:6901414b1d93b5bc046ea7d946722c56baf503743243bed97ef2f98e05af1742 +size 27775 diff --git a/bash.changes b/bash.changes index c397851..533405a 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Mar 21 11:51:54 UTC 2013 - werner@suse.de + +- Add patch from upstream mailing list to speed up array handling +- Add patch from upstream mailing list to avoid fdleaks +- Use lsdiff to determine the depth of the leading slashes in a + patch file + ------------------------------------------------------------------- Fri Mar 15 15:35:51 UTC 2013 - werner@suse.de diff --git a/bash.spec b/bash.spec index 9ed4ebc..f955c80 100644 --- a/bash.spec +++ b/bash.spec @@ -27,6 +27,7 @@ BuildRequires: fdupes BuildRequires: makeinfo %endif BuildRequires: ncurses-devel +BuildRequires: patchutils BuildRequires: screen %define bash_vers 4.2 %define rl_vers 6.2 @@ -269,14 +270,19 @@ as well as programming with the interface of the readline library. %prep %setup -q -n bash-%{bash_vers}%{extend} -b1 -b2 -b3 +typeset -i level for patch in ../bash-%{bash_vers}-patches/*; do - level=-p1 test -e $patch || break - [[ $(head -n 1 $patch) =~ From ]] || level=-p0 + let level=0 || true + file=$(lsdiff --files=1 $patch) + if test ! -e $file ; then + file=${file#*/} + let level++ || true + fi + test -e $file || exit 1 echo Patch $patch - patch -s $level < $patch + patch -s -p$level < $patch done -unset p %patch1 -p0 -b .manual %patch2 -p0 -b .security %patch3 -p0 -b .2.4.4 @@ -308,10 +314,16 @@ unset p %patch47 %patch0 -p0 -b .0 pushd ../readline-%{rl_vers}%{extend} -for p in ../readline-%{rl_vers}-patches/*; do - test -e $p || break - echo Patch $p - patch -s -p0 < $p +for patch in ../readline-%{rl_vers}-patches/*; do + test -e $patch || break + let level=0 || true + file=$(lsdiff --files=1 $patch) + if test ! -e $file ; then + file=${file#*/} + let level++ || true + fi + echo Patch $patch + patch -s -p$level < $patch done %patch21 -p2 -b .zerotty %patch22 -p2 -b .wrap