Accepting request 160437 from Base:System

- 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

- 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

OBS-URL: https://build.opensuse.org/request/show/160437
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bash?expand=0&rev=107
This commit is contained in:
Stephan Kulow 2013-03-22 10:00:46 +00:00 committed by Git OBS Bridge
commit 2f79f28753
5 changed files with 84 additions and 16 deletions

View File

@ -12,19 +12,19 @@
/* We have committed to attempting to execute the contents of this file /* We have committed to attempting to execute the contents of this file
as shell commands. */ as shell commands. */
+#if 1 +#if defined(BNC382214) && (BNC382214 == 1)
+ larray = strvec_len(args) + 1; + larray = strvec_len(args) + 1;
+ args = strvec_resize(args, larray + 1); + args = strvec_resize(args, larray + 1);
+ +
+ for (i = larray - 1; i; i--) + for (i = larray - 1; i; i--)
+ args[i] = args[i - 1]; + 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[1] = command;
+ args[larray] = (char *)0; + args[larray] = (char *)0;
+ +
+ SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ + SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */
+ execve ("/bin/sh", args, env); + execve (args[0], args, env);
+ SETOSTYPE (1); + SETOSTYPE (1);
+ +
+ internal_error (_("%s: cannot execute: %s"), command, strerror (errno)); + internal_error (_("%s: cannot execute: %s"), command, strerror (errno));

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:251f7aa87048b2ad274e6006e234a1d6270bc074cc779308c2117dcf17f73723 oid sha256:6901414b1d93b5bc046ea7d946722c56baf503743243bed97ef2f98e05af1742
size 25471 size 27775

View File

@ -1,3 +1,32 @@
-------------------------------------------------------------------
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
- 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 Tue Feb 12 07:58:08 UTC 2013 - schwab@suse.de

View File

@ -27,6 +27,8 @@ BuildRequires: fdupes
BuildRequires: makeinfo BuildRequires: makeinfo
%endif %endif
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: patchutils
BuildRequires: screen
%define bash_vers 4.2 %define bash_vers 4.2
%define rl_vers 6.2 %define rl_vers 6.2
%define extend "" %define extend ""
@ -73,6 +75,7 @@ Patch11: bash-4.0-loadables.dif
Patch12: bash-4.1-completion.dif Patch12: bash-4.1-completion.dif
Patch13: bash-4.2-nscdunmap.dif Patch13: bash-4.2-nscdunmap.dif
Patch14: bash-4.2-sigrestart.patch Patch14: bash-4.2-sigrestart.patch
# PATCH-FIX-UPSTREAM bnc#382214 -- disabled due bnc#806628 by -DBNC382214=0
Patch15: bash-3.2-longjmp.dif Patch15: bash-3.2-longjmp.dif
Patch16: bash-4.0-setlocale.dif Patch16: bash-4.0-setlocale.dif
Patch17: bash-4.0-headers.dif Patch17: bash-4.0-headers.dif
@ -267,14 +270,19 @@ as well as programming with the interface of the readline library.
%prep %prep
%setup -q -n bash-%{bash_vers}%{extend} -b1 -b2 -b3 %setup -q -n bash-%{bash_vers}%{extend} -b1 -b2 -b3
typeset -i level
for patch in ../bash-%{bash_vers}-patches/*; do for patch in ../bash-%{bash_vers}-patches/*; do
level=-p1
test -e $patch || break 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 echo Patch $patch
patch -s $level < $patch patch -s -p$level < $patch
done done
unset p
%patch1 -p0 -b .manual %patch1 -p0 -b .manual
%patch2 -p0 -b .security %patch2 -p0 -b .security
%patch3 -p0 -b .2.4.4 %patch3 -p0 -b .2.4.4
@ -306,10 +314,16 @@ unset p
%patch47 %patch47
%patch0 -p0 -b .0 %patch0 -p0 -b .0
pushd ../readline-%{rl_vers}%{extend} pushd ../readline-%{rl_vers}%{extend}
for p in ../readline-%{rl_vers}-patches/*; do for patch in ../readline-%{rl_vers}-patches/*; do
test -e $p || break test -e $patch || break
echo Patch $p let level=0 || true
patch -s -p0 < $p 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 done
%patch21 -p2 -b .zerotty %patch21 -p2 -b .zerotty
%patch22 -p2 -b .wrap %patch22 -p2 -b .wrap
@ -329,6 +343,22 @@ done
LANG=POSIX LANG=POSIX
LC_ALL=$LANG LC_ALL=$LANG
unset LC_CTYPE 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) CPU=$(uname -m 2> /dev/null)
HOSTTYPE=${CPU} HOSTTYPE=${CPU}
MACHTYPE=${CPU}-suse-linux MACHTYPE=${CPU}-suse-linux
@ -387,6 +417,7 @@ pushd ../readline-%{rl_vers}%{extend}
cflags -Wno-unused-parameter CFLAGS cflags -Wno-unused-parameter CFLAGS
cflags -ftree-loop-linear CFLAGS cflags -ftree-loop-linear CFLAGS
cflags -pipe CFLAGS cflags -pipe CFLAGS
cflags -DBNC382214=0 CFLAGS
cflags -Wl,--as-needed LDFLAGS cflags -Wl,--as-needed LDFLAGS
cflags -Wl,-O2 LDFLAGS cflags -Wl,-O2 LDFLAGS
cflags -Wl,--hash-size=8599 LDFLAGS cflags -Wl,--hash-size=8599 LDFLAGS
@ -511,7 +542,11 @@ popd
make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_generate"} \ 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 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 %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_feedback" clean} all
make -C examples/loadables/ make -C examples/loadables/
make documentation make documentation

View File

@ -20,7 +20,7 @@ echo Any output from any test, unless otherwise noted, indicates a possible anom
for x in run-* for x in run-*
do do
case $x in 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|*~) ;; *.orig|*~) ;;
*) echo $x ; sh $x ;; *) echo $x ; sh $x ;;
esac esac
@ -40,4 +40,8 @@ time while ((count-- > 0)) ; do
${THIS_SH} -c $tmp ${THIS_SH} -c $tmp
done done
echo '#########################' echo '#########################'
set -x
read -t1 < /dev/tty
set +x
echo '#########################'
exit 0 exit 0