Hello community, here is the log from the commit of package bash for openSUSE:Factory checked in at 2013-03-22 11:00:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bash (Old) and /work/SRC/openSUSE:Factory/.bash.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bash", Maintainer is "wer...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/bash/bash.changes 2013-02-12 17:41:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.bash.new/bash.changes 2013-03-22 11:00:48.000000000 +0100 @@ -1,0 +2,29 @@ +Thu Mar 21 11:51:54 UTC 2013 - wer...@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 - wer...@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 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bash.spec ++++++ --- /var/tmp/diff_new_pack.0Ucacg/_old 2013-03-22 11:00:56.000000000 +0100 +++ /var/tmp/diff_new_pack.0Ucacg/_new 2013-03-22 11:00:56.000000000 +0100 @@ -27,6 +27,8 @@ BuildRequires: makeinfo %endif BuildRequires: ncurses-devel +BuildRequires: patchutils +BuildRequires: screen %define bash_vers 4.2 %define rl_vers 6.2 %define extend "" @@ -73,6 +75,7 @@ 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 @@ -267,14 +270,19 @@ %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 @@ -306,10 +314,16 @@ %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 @@ -329,6 +343,22 @@ 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 +417,7 @@ 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 @@ -511,7 +542,11 @@ make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_generate"} \ 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 ++++++ bash-3.2-longjmp.dif ++++++ --- /var/tmp/diff_new_pack.0Ucacg/_old 2013-03-22 11:00:56.000000000 +0100 +++ /var/tmp/diff_new_pack.0Ucacg/_new 2013-03-22 11:00:56.000000000 +0100 @@ -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)); ++++++ bash-4.2-patches.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-4.2-patches/bash-4.2-array-lastref.patch new/bash-4.2-patches/bash-4.2-array-lastref.patch --- old/bash-4.2-patches/bash-4.2-array-lastref.patch 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-4.2-patches/bash-4.2-array-lastref.patch 2013-03-21 10:50:31.000000000 +0100 @@ -0,0 +1,135 @@ +| +| Message-ID: <4f6347c2.70...@case.edu> +| From: Chet Ramey <chet.ra...@case.edu> +| Subject: Re: [bug-bash] bug: bash 4.2.20 impossibly slow +| +*** ../bash-4.2-patched/array.c 2009-03-29 22:16:43.000000000 -0400 +--- array.c 2012-03-16 09:25:09.000000000 -0400 +*************** +*** 59,63 **** + static ARRAY_ELEMENT *lastref = 0; + +! #define IS_LASTREF(a) ((a) == lastarray) + + #define INVALIDATE_LASTREF(a) \ +--- 59,67 ---- + static ARRAY_ELEMENT *lastref = 0; + +! #define IS_LASTREF(a) (lastarray && (a) == lastarray) +! +! #define LASTREF_START(a, i) \ +! (IS_LASTREF(a) && i >= element_index(lastref)) ? lastref \ +! : element_forw(a->head) + + #define INVALIDATE_LASTREF(a) \ +*************** +*** 611,615 **** + char *v; + { +! register ARRAY_ELEMENT *new, *ae; + + if (a == 0) +--- 615,619 ---- + char *v; + { +! register ARRAY_ELEMENT *new, *ae, *start; + + if (a == 0) +*************** +*** 629,635 **** + } + /* +! * Otherwise we search for the spot to insert it. + */ +! for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + if (element_index(ae) == i) { + /* +--- 633,642 ---- + } + /* +! * Otherwise we search for the spot to insert it. The lastref +! * handle optimizes the case of sequential or almost-sequential +! * assignments that are not at the end of the array. + */ +! start = LASTREF_START(a, i); +! for (ae = start; ae != a->head; ae = element_forw(ae)) { + if (element_index(ae) == i) { + /* +*************** +*** 648,651 **** +--- 655,659 ---- + } + } ++ array_dispose_element(new); + INVALIDATE_LASTREF(a); + return (-1); /* problem */ +*************** +*** 661,669 **** + arrayind_t i; + { +! register ARRAY_ELEMENT *ae; + + if (a == 0 || array_empty(a)) + return((ARRAY_ELEMENT *) NULL); +! for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + ae->next->prev = ae->prev; +--- 669,678 ---- + arrayind_t i; + { +! register ARRAY_ELEMENT *ae, *start; + + if (a == 0 || array_empty(a)) + return((ARRAY_ELEMENT *) NULL); +! start = LASTREF_START(a, i); +! for (ae = start; ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + ae->next->prev = ae->prev; +*************** +*** 672,676 **** +--- 681,694 ---- + if (i == array_max_index(a)) + a->max_index = element_index(ae->prev); ++ #if 0 + INVALIDATE_LASTREF(a); ++ #else ++ if (ae->next != a->head) ++ SET_LASTREF(a, ae->next); ++ else if (ae->prev != a->head) ++ SET_LASTREF(a, ae->prev); ++ else ++ INVALIDATE_LASTREF(a); ++ #endif + return(ae); + } +*************** +*** 686,701 **** + arrayind_t i; + { +! register ARRAY_ELEMENT *ae; + + if (a == 0 || array_empty(a)) + return((char *) NULL); + if (i > array_max_index(a)) +! return((char *)NULL); +! /* Keep roving pointer into array to optimize sequential access */ +! if (lastref && IS_LASTREF(a)) +! ae = (i >= element_index(lastref)) ? lastref : element_forw(a->head); +! else +! ae = element_forw(a->head); +! for ( ; ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + SET_LASTREF(a, ae); +--- 704,715 ---- + arrayind_t i; + { +! register ARRAY_ELEMENT *ae, *start; + + if (a == 0 || array_empty(a)) + return((char *) NULL); + if (i > array_max_index(a)) +! return((char *)NULL); /* Keep roving pointer into array to optimize sequential access */ +! start = LASTREF_START(a, i); +! for (ae = start; ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + SET_LASTREF(a, ae); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-4.2-patches/bash-4.2-fdleaks.patch new/bash-4.2-patches/bash-4.2-fdleaks.patch --- old/bash-4.2-patches/bash-4.2-fdleaks.patch 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-4.2-patches/bash-4.2-fdleaks.patch 2013-03-21 11:33:26.000000000 +0100 @@ -0,0 +1,42 @@ +| +| Message-Id: <1359068039-19742-1-git-send-email-rra...@redhat.com> +| +| There are missing calls of close() leading to resource leak (fd leak). +| Simple reproducer: +| . / +| and /proc/$$/fd contain one open fd for each above call +| +| Signed-off-by: Roman Rakus <rra...@redhat.com> +| --- +| builtins/evalfile.c | 3 +++ +| 1 file changed, 3 insertions(+) +| +diff --git a/builtins/evalfile.c b/builtins/evalfile.c +index 60f89d1..d30bd96 100644 +--- a/builtins/evalfile.c ++++ b/builtins/evalfile.c +@@ -133,11 +133,13 @@ file_error_and_exit: + if (S_ISDIR (finfo.st_mode)) + { + (*errfunc) (_("%s: is a directory"), filename); ++ close(fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + else if ((flags & FEVAL_REGFILE) && S_ISREG (finfo.st_mode) == 0) + { + (*errfunc) (_("%s: not a regular file"), filename); ++ close(fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + +@@ -146,6 +148,7 @@ file_error_and_exit: + if (file_size != finfo.st_size || file_size + 1 < file_size) + { + (*errfunc) (_("%s: file is too large"), filename); ++ close(fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + +-- +1.7.11.7 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-4.2-patches/bash42-043 new/bash-4.2-patches/bash42-043 --- old/bash-4.2-patches/bash42-043 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-4.2-patches/bash42-043 2013-03-07 21:05:00.000000000 +0100 @@ -0,0 +1,65 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-043 + +Bug-Reported-by: konsolebox <konsole...@gmail.com> +Bug-Reference-ID: <cajnmqwzugklgmsmwxrk4ll+2nn+hgvmkzrnode99qbgrcgx...@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-01/msg00138.html + +Bug-Description: + +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. + +Patch (apply with `patch -p0'): + +*** ../bash-4.2-patched/builtins/read.def 2012-10-31 21:22:51.000517000 -0400 +--- builtins/read.def 2013-01-25 10:28:16.000038000 -0500 +*************** +*** 386,393 **** + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, +! so we have to remove it from the stack. */ +! remove_unwind_protect (); +! run_unwind_frame ("read_builtin"); + input_string[i] = '\0'; /* make sure it's terminated */ + retval = 128+SIGALRM; + goto assign_vars; +--- 386,403 ---- + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, +! so we have to save input_string temporarily, run the unwind- +! protects, then restore input_string so we can use it later. */ +! + input_string[i] = '\0'; /* make sure it's terminated */ ++ if (i == 0) ++ { ++ t = (char *)xmalloc (1); ++ t[0] = 0; ++ } ++ else ++ t = savestring (input_string); ++ ++ run_unwind_frame ("read_builtin"); ++ input_string = t; + retval = 128+SIGALRM; + goto assign_vars; + +*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010 +--- patchlevel.h Thu Feb 24 21:41:34 2011 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 42 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 43 + + #endif /* _PATCHLEVEL_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-4.2-patches/bash42-044 new/bash-4.2-patches/bash42-044 --- old/bash-4.2-patches/bash42-044 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-4.2-patches/bash42-044 2013-03-07 21:05:11.000000000 +0100 @@ -0,0 +1,70 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-044 + +Bug-Reported-by: "Dashing" <dash...@hushmail.com> +Bug-Reference-ID: <20130211175049.d90786f...@smtp.hushmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00030.html + +Bug-Description: + +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. + +Patch (apply with `patch -p0'): + +*** ../bash-4.2-patched/lib/glob/xmbsrtowcs.c 2012-07-08 21:53:19.000000000 -0400 +--- lib/glob/xmbsrtowcs.c 2013-02-12 12:00:39.000000000 -0500 +*************** +*** 217,220 **** +--- 217,226 ---- + n = mbsnrtowcs(wsbuf+wcnum, &p, nms, wsbuf_size-wcnum, &state); + ++ if (n == 0 && p == 0) ++ { ++ wsbuf[wcnum] = L'\0'; ++ break; ++ } ++ + /* Compensate for taking single byte on wcs conversion failure above. */ + if (wcslength == 1 && (n == 0 || n == (size_t)-1)) +*************** +*** 222,226 **** + state = tmp_state; + p = tmp_p; +! wsbuf[wcnum++] = *p++; + } + else +--- 228,238 ---- + state = tmp_state; + p = tmp_p; +! wsbuf[wcnum] = *p; +! if (*p == 0) +! break; +! else +! { +! wcnum++; p++; +! } + } + else + +*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010 +--- patchlevel.h Thu Feb 24 21:41:34 2011 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 43 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 44 + + #endif /* _PATCHLEVEL_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-4.2-patches/bash42-045 new/bash-4.2-patches/bash42-045 --- old/bash-4.2-patches/bash42-045 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-4.2-patches/bash42-045 2013-03-07 21:05:30.000000000 +0100 @@ -0,0 +1,53 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.2 +Patch-ID: bash42-045 + +Bug-Reported-by: Stephane Chazelas <stephane.chaze...@gmail.com> +Bug-Reference-ID: <20130218195539.ga9...@chaz.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00080.html + +Bug-Description: + +The <&n- and >&n- redirections, which move one file descriptor to another, +leave the file descriptor closed when applied to builtins or compound +commands. + +Patch (apply with `patch -p0'): + +*** ../bash-4.2-patched/redir.c 2013-01-30 11:56:09.000000000 -0500 +--- redir.c 2013-02-19 09:38:36.000000000 -0500 +*************** +*** 1008,1011 **** +--- 1008,1021 ---- + REDIRECTION_ERROR (r, errno, -1); + } ++ if ((flags & RX_UNDOABLE) && (ri == r_move_input || ri == r_move_output)) ++ { ++ /* r_move_input and r_move_output add an additional close() ++ that needs to be undone */ ++ if (fcntl (redirector, F_GETFD, 0) != -1) ++ { ++ r = add_undo_redirect (redir_fd, r_close_this, -1); ++ REDIRECTION_ERROR (r, errno, -1); ++ } ++ } + #if defined (BUFFERED_INPUT) + check_bash_input (redirector); + +*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010 +--- patchlevel.h Thu Feb 24 21:41:34 2011 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 44 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 45 + + #endif /* _PATCHLEVEL_H_ */ ++++++ run-tests ++++++ --- /var/tmp/diff_new_pack.0Ucacg/_old 2013-03-22 11:00:56.000000000 +0100 +++ /var/tmp/diff_new_pack.0Ucacg/_new 2013-03-22 11:00:56.000000000 +0100 @@ -20,7 +20,7 @@ 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 @@ ${THIS_SH} -c $tmp done echo '#########################' +set -x +read -t1 < /dev/tty +set +x +echo '#########################' exit 0 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org