diffstat of debian/ for coreutils_8.13-3 coreutils_8.13-3ubuntu3.3 coreutils-8.13/debian/changelog | 114 ++++++++++++++++++++ coreutils-8.13/debian/control | 6 - coreutils-8.13/debian/patches/00list | 4 coreutils-8.13/debian/rules | 2 debian/patches/80_fedora_sysinfo.dpatch | 75 +++++++++++++ debian/patches/99_cp_fiemap_FMR.dpatch | 104 ++++++++++++++++++ debian/patches/99_sort_-u_data_loss.dpatch | 163 +++++++++++++++++++++++++++++ debian/patches/CVE-2014-9471.dpatch | 54 +++++++++ 8 files changed, 519 insertions(+), 3 deletions(-) diff -u coreutils-8.13/debian/control coreutils-8.13/debian/control --- coreutils-8.13/debian/control +++ coreutils-8.13/debian/control @@ -1,12 +1,14 @@ Source: coreutils -Maintainer: Michael Stone +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Michael Stone Section: utils Priority: required Standards-Version: 3.9.2.0 -Build-Depends: gettext (>= 0.10.37), debhelper (>= 5.0.0), dh-buildinfo, texinfo (>= 4.2), groff, dpatch, libattr1-dev | not+linux-gnu, libacl1-dev | not+linux-gnu, libselinux1-dev (>= 1.32) | not+linux-gnu, gperf, bison +Build-Depends: gettext:any (>= 0.10.37), debhelper (>= 5.0.0), dh-buildinfo, texinfo (>= 4.2), groff, dpatch, libattr1-dev | not+linux-gnu, libacl1-dev | not+linux-gnu, libselinux1-dev (>= 1.32) | not+linux-gnu, gperf, bison, valgrind [!armhf] Package: coreutils Architecture: any +Multi-Arch: foreign Pre-Depends: ${shlibs:Depends} Essential: yes Replaces: mktemp, timeout diff -u coreutils-8.13/debian/changelog coreutils-8.13/debian/changelog --- coreutils-8.13/debian/changelog +++ coreutils-8.13/debian/changelog @@ -1,3 +1,58 @@ +coreutils (8.13-3ubuntu3.3) precise-security; urgency=medium + + * SECURITY UPDATE: infinite loop or crash in TZ environment variable + handling. + - debian/patches/CVE-2014-9471.dpatch: modify lib/parse-datetime.y and + tests/misc/date to avoid crashing with malformed TZ + - CVE-2014-9471 + + -- Seth Arnold Tue, 13 Jan 2015 19:31:30 -0800 + +coreutils (8.13-3ubuntu3.2) precise-proposed; urgency=low + + * Backport upstream patch to avoid data-corrupting free-memory-read in + cp/mv/install when dealing with a very fragmented and sparse input file + on certain filesystems (LP: #1073514). + * Build-depend on valgrind (except on armhf, where it breaks) in order to + be able to run the test for the above fix. + * Fix 99_sort_-u_data_loss.dpatch so that the added test is actually run. + * Backport require_valgrind_ so that tests work better. + * Make valgrind failures non-fatal; we don't have sufficiently accurate + suppressions for linker startup issues on all architectures. However, + do still run those tests and check for corrupted output. + + -- Colin Watson Fri, 09 Nov 2012 14:23:10 +0000 + +coreutils (8.13-3ubuntu3.1) precise-proposed; urgency=low + + * Backport upstream patches to fix data-loss and free-memory read bugs in + 'sort -u' (LP: #1038468). + + -- Colin Watson Mon, 10 Sep 2012 14:32:58 +0100 + +coreutils (8.13-3ubuntu3) precise; urgency=low + + * Build-depend on gettext:any instead of on gettext, so that apt-get can + properly resolve build-dependencies on the tool when cross-building. + + -- Steve Langasek Sat, 31 Mar 2012 14:54:13 -0700 + +coreutils (8.13-3ubuntu2) precise; urgency=low + + * Mark coreutils Multi-Arch: foreign. + + -- Colin Watson Sun, 20 Nov 2011 17:21:08 +0000 + +coreutils (8.13-3ubuntu1) precise; urgency=low + + * Resynchronise with Debian. Remaining changes: + - [80] Make 'uname -i -p' return the real processor/hardware, instead of + unknown. + * Filter out -Werror=format-security from CFLAGS when building tests, to + avoid a build failure in gnulib-tests/test-xvasprintf.c. + + -- Colin Watson Tue, 18 Oct 2011 10:59:14 +0100 + coreutils (8.13-3) unstable; urgency=low * [86] upstream patch for ppc float issue (Closes: #642291) @@ -31,6 +86,51 @@ -- Michael Stone Mon, 12 Sep 2011 17:21:19 -0400 +coreutils (8.5-1ubuntu6) natty; urgency=low + + * Backport from upstream (Jim Meyering): + - tail: avoid new diagnostic when applying -f to a pipe on linux-2.6.38. + + -- Colin Watson Wed, 23 Feb 2011 13:06:43 +0000 + +coreutils (8.5-1ubuntu5) natty; urgency=low + + * debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the + real processor/hardware, instead of unknown. Patch cherry-picked from + Fedora 12 (original: coreutils-4.5.3-sysinfo.patch, from the + coreutils-7.6-5.src.rpm). LP: #470550. + + -- C de-Avillez Tue, 10 Nov 2009 12:38:24 -0600 + +coreutils (8.5-1ubuntu4) natty; urgency=low + + * No-change upload to drop upstream changelog, and build with natty + toolchain. + + -- Martin Pitt Fri, 03 Dec 2010 08:40:09 +0100 + +coreutils (8.5-1ubuntu3) maverick; urgency=low + + * Maybe test that the package builds first before uploading; dpatch is a + picky one, isn't it? + + -- Steve Langasek Fri, 11 Jun 2010 06:49:02 +0000 + +coreutils (8.5-1ubuntu2) maverick; urgency=low + + [ John Rigby ] + * debian/patches/99_stat_prototype_for_linkat.dpatch: Add missing header + include for stat() prototype. LP: #591968. + + -- Steve Langasek Fri, 11 Jun 2010 06:03:58 +0000 + +coreutils (8.5-1ubuntu1) maverick; urgency=low + + * Merge from Debian unstable, remaining changes: + - debian/rules: Do not install dangling LC_TIME symlinks + + -- Steve Langasek Mon, 07 Jun 2010 01:41:56 +0000 + coreutils (8.5-1) unstable; urgency=low * New upstream version @@ -127,6 +227,20 @@ -- Michael Stone Wed, 02 Sep 2009 20:50:02 -0400 +coreutils (7.4-2ubuntu2) lucid; urgency=low + + * rebuild rest of main for armel armv7/thumb2 optimization; + UbuntuSpec:mobile-lucid-arm-gcc-v7-thumb2 + + -- Alexander Sack Fri, 05 Mar 2010 04:06:08 +0100 + +coreutils (7.4-2ubuntu1) karmic; urgency=low + + * debian/rules: Do not install dangling LC_TIME symlinks, they are not + needed. (LP: #42293) + + -- Martin Pitt Tue, 06 Oct 2009 12:22:48 +0200 + coreutils (7.4-2) unstable; urgency=low * move mktemp to /bin instead of /usr/bin (Closes: #531842) diff -u coreutils-8.13/debian/rules coreutils-8.13/debian/rules --- coreutils-8.13/debian/rules +++ coreutils-8.13/debian/rules @@ -69,7 +69,7 @@ $(MAKE) ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) ifeq (,$(findstring mips,$(DEB_BUILD_ARCH))) - $(MAKE) check VERBOSE=yes + $(MAKE) check VERBOSE=yes CFLAGS="$(filter-out -Werror=format-security,$(CFLAGS))" endif endif echo built > build-stamp diff -u coreutils-8.13/debian/patches/00list coreutils-8.13/debian/patches/00list --- coreutils-8.13/debian/patches/00list +++ coreutils-8.13/debian/patches/00list @@ -1,6 +1,7 @@ 61_whoips 63_dd-appenderrors 72_id_checkngroups +80_fedora_sysinfo 84_getcwd 85_timer_settime 86_float_ppc @@ -10,0 +12,3 @@ +99_sort_-u_data_loss +99_cp_fiemap_FMR +CVE-2014-9471 --- coreutils-8.13.orig/debian/patches/CVE-2014-9471.dpatch +++ coreutils-8.13/debian/patches/CVE-2014-9471.dpatch @@ -0,0 +1,54 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## CVE-2014-9471.dpatch by Seth Arnold +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Origin: http://debbugs.gnu.org/cgi/bugreport.cgi?msg=11;filename=date-tz-crash.patch;att=1;bug=16872 +## DP: Origin: http://debbugs.gnu.org/cgi/bugreport.cgi?msg=19;filename=coreutils-date-crash.patch;att=1;bug=16872 +## DP: Combined from previous two URLs, dropping NEWS entries +## DP: Description: parse-datetime: fix crash or infloop in TZ="" parsing +## DP: Author: =?UTF-8?q?P=C3=A1draig=20Brady?= + + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/lib/parse-datetime.y coreutils-8.13/lib/parse-datetime.y +--- coreutils-8.13~/lib/parse-datetime.y 2011-08-31 09:58:04.000000000 -0700 ++++ coreutils-8.13/lib/parse-datetime.y 2015-01-09 17:30:06.916967256 -0800 +@@ -1295,8 +1295,6 @@ + char tz1buf[TZBUFSIZE]; + bool large_tz = TZBUFSIZE < tzsize; + bool setenv_ok; +- /* Free tz0, in case this is the 2nd or subsequent time through. */ +- free (tz0); + tz0 = get_tz (tz0buf); + z = tz1 = large_tz ? xmalloc (tzsize) : tz1buf; + for (s = tzbase; *s != '"'; s++) +@@ -1308,7 +1306,12 @@ + if (!setenv_ok) + goto fail; + tz_was_altered = true; ++ + p = s + 1; ++ while (c = *p, c_isspace (c)) ++ p++; ++ ++ break; + } + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/misc/date coreutils-8.13/tests/misc/date +--- coreutils-8.13~/tests/misc/date 2011-08-31 11:00:55.000000000 -0700 ++++ coreutils-8.13/tests/misc/date 2015-01-09 17:29:42.308966886 -0800 +@@ -282,6 +282,13 @@ + # most others print 'WED DEC 8 07:30:00 1999'. + {OUT_SUBST => 's/ [ 0]8.*//'}, + {OUT=>'WED DEC'}], ++ ++ # From coreutils-5.3.0 to 8.22 inclusive ++ # this would either infinite loop or crash ++ ['invalid-TZ-crash', "-d 'TZ=\"\"\"'", ++ {ERR => "date: invalid date `TZ=\"\"\"'\n"}, ++ {EXIT => 1}, ++ ], + ); + + # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364. --- coreutils-8.13.orig/debian/patches/99_cp_fiemap_FMR.dpatch +++ coreutils-8.13/debian/patches/99_cp_fiemap_FMR.dpatch @@ -0,0 +1,104 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99_cp_fiemap_FMR.dpatch by Colin Watson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Avoid data-corrupting free-memory-read in cp/mv/install when dealing +## DP: with a very fragmented and sparse input file on certain filesystems. +## DP: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=64aef5fb9afecc023a6e719da161dbbf450908b8 + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/src/extent-scan.c coreutils-8.13/src/extent-scan.c +--- coreutils-8.13~/src/extent-scan.c 2011-07-28 11:38:27.000000000 +0100 ++++ coreutils-8.13/src/extent-scan.c 2012-11-09 09:57:17.000000000 +0000 +@@ -89,7 +89,7 @@ + extent_scan_read (struct extent_scan *scan) + { + unsigned int si = 0; +- struct extent_info *last_ei IF_LINT ( = scan->ext_info); ++ struct extent_info *last_ei = scan->ext_info; + + while (true) + { +@@ -127,8 +127,14 @@ + + assert (scan->ei_count <= SIZE_MAX - fiemap->fm_mapped_extents); + scan->ei_count += fiemap->fm_mapped_extents; +- scan->ext_info = xnrealloc (scan->ext_info, scan->ei_count, +- sizeof (struct extent_info)); ++ { ++ /* last_ei points into a buffer that may be freed via xnrealloc. ++ Record its offset and adjust after allocation. */ ++ size_t prev_idx = last_ei - scan->ext_info; ++ scan->ext_info = xnrealloc (scan->ext_info, scan->ei_count, ++ sizeof (struct extent_info)); ++ last_ei = scan->ext_info + prev_idx; ++ } + + unsigned int i = 0; + for (i = 0; i < fiemap->fm_mapped_extents; i++) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/Makefile.am coreutils-8.13/tests/Makefile.am +--- coreutils-8.13~/tests/Makefile.am 2012-11-09 09:57:16.000000000 +0000 ++++ coreutils-8.13/tests/Makefile.am 2012-11-09 09:57:17.000000000 +0000 +@@ -328,6 +328,7 @@ + cp/existing-perm-race \ + cp/fail-perm \ + cp/fiemap-empty \ ++ cp/fiemap-FMR \ + cp/fiemap-perf \ + cp/fiemap-2 \ + cp/file-perm-race \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/Makefile.in coreutils-8.13/tests/Makefile.in +--- coreutils-8.13~/tests/Makefile.in 2012-11-09 09:57:16.000000000 +0000 ++++ coreutils-8.13/tests/Makefile.in 2012-11-09 09:57:17.000000000 +0000 +@@ -1682,6 +1682,7 @@ + cp/existing-perm-race \ + cp/fail-perm \ + cp/fiemap-empty \ ++ cp/fiemap-FMR \ + cp/fiemap-perf \ + cp/fiemap-2 \ + cp/file-perm-race \ +@@ -2775,6 +2776,8 @@ + @p='cp/fail-perm'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + cp/fiemap-empty.log: cp/fiemap-empty + @p='cp/fiemap-empty'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) ++cp/fiemap-FMR.log: cp/fiemap-FMR ++ @p='cp/fiemap-FMR'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + cp/fiemap-perf.log: cp/fiemap-perf + @p='cp/fiemap-perf'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + cp/fiemap-2.log: cp/fiemap-2 +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/cp/fiemap-FMR coreutils-8.13/tests/cp/fiemap-FMR +--- coreutils-8.13~/tests/cp/fiemap-FMR 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.13/tests/cp/fiemap-FMR 2012-11-09 09:57:29.000000000 +0000 +@@ -0,0 +1,31 @@ ++#!/bin/sh ++# Trigger a free-memory read bug in cp from coreutils-[8.11..8.19] ++ ++# Copyright (C) 2012 Free Software Foundation, Inc. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../src ++print_ver_ cp ++ ++require_valgrind_ ++require_perl_ ++: ${PERL=perl} ++ ++$PERL -e 'for (1..600) { sysseek (*STDOUT, 4096, 1)' \ ++ -e '&& syswrite (*STDOUT, "a" x 1024) or die "$!"}' > j || fail=1 ++valgrind --quiet --error-exitcode=3 cp j j2 || true # fail=1 ++cmp j j2 || fail=1 ++ ++Exit $fail --- coreutils-8.13.orig/debian/patches/99_sort_-u_data_loss.dpatch +++ coreutils-8.13/debian/patches/99_sort_-u_data_loss.dpatch @@ -0,0 +1,163 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99_sort_-u_data_loss.dpatch by Colin Watson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix data-loss and free-memory read bugs in 'sort -u'. +## DP: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=eb3f5b3b3de8c6ca005a701f09bff43d778aece7 +## DP: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=574b7c7dbec8821d03a462796968847783d07c29 +## DP: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=46444af9e485b95f7ddf24c7fd9ed2586209286c + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/THANKS.in coreutils-8.13/THANKS.in +--- coreutils-8.13~/THANKS.in 2011-08-08 09:16:09.000000000 +0100 ++++ coreutils-8.13/THANKS.in 2012-11-09 09:53:52.000000000 +0000 +@@ -486,6 +486,7 @@ + Rainer Orth ro@TechFak.Uni-Bielefeld.DE + Ralf W. Stephan stephan@tmt.de + Ralph Loader loader@maths.ox.ac.uk ++Rasmus Borup Hansen rbh@intomics.com + Raul Miller moth@magenta.com + Raúl Núñez de Arenas Coronado raul@pleyades.net + Richard A Downing richard.downing@bcs.org.uk +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/src/sort.c coreutils-8.13/src/sort.c +--- coreutils-8.13~/src/sort.c 2011-07-29 09:12:25.000000000 +0100 ++++ coreutils-8.13/src/sort.c 2012-11-09 09:53:52.000000000 +0000 +@@ -263,6 +263,9 @@ + when popping. */ + }; + ++/* Used to implement --unique (-u). */ ++static struct line saved_line; ++ + /* FIXME: None of these tables work with multibyte character sets. + Also, there are many other bugs when handling multibyte characters. + One way to fix this is to rewrite `sort' to use wide characters +@@ -3320,13 +3323,11 @@ + static void + write_unique (struct line const *line, FILE *tfp, char const *temp_output) + { +- static struct line saved; +- + if (unique) + { +- if (saved.text && ! compare (line, &saved)) ++ if (saved_line.text && ! compare (line, &saved_line)) + return; +- saved = *line; ++ saved_line = *line; + } + + write_line (line, tfp, temp_output); +@@ -3831,6 +3832,7 @@ + break; + } + ++ saved_line.text = NULL; + line = buffer_linelim (&buf); + if (buf.eof && !nfiles && !ntemps && !buf.left) + { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/Makefile.am coreutils-8.13/tests/Makefile.am +--- coreutils-8.13~/tests/Makefile.am 2011-09-02 13:08:40.000000000 +0100 ++++ coreutils-8.13/tests/Makefile.am 2012-11-09 09:53:52.000000000 +0000 +@@ -249,6 +249,7 @@ + misc/sort-unique \ + misc/sort-unique-segv \ + misc/sort-version \ ++ misc/sort-u-FMR \ + split/filter \ + split/suffix-length \ + split/b-chunk \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/Makefile.in coreutils-8.13/tests/Makefile.in +--- coreutils-8.13~/tests/Makefile.in 2012-11-09 09:53:51.000000000 +0000 ++++ coreutils-8.13/tests/Makefile.in 2012-11-09 09:53:52.000000000 +0000 +@@ -1603,6 +1603,7 @@ + misc/sort-unique \ + misc/sort-unique-segv \ + misc/sort-version \ ++ misc/sort-u-FMR \ + split/filter \ + split/suffix-length \ + split/b-chunk \ +@@ -2616,6 +2617,8 @@ + @p='misc/sort-unique-segv'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + misc/sort-version.log: misc/sort-version + @p='misc/sort-version'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) ++misc/sort-u-FMR.log: misc/sort-u-FMR ++ @p='misc/sort-u-FMR'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + split/filter.log: split/filter + @p='split/filter'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + split/suffix-length.log: split/suffix-length +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/init.cfg coreutils-8.13/tests/init.cfg +--- coreutils-8.13~/tests/init.cfg 2012-11-09 09:53:51.000000000 +0000 ++++ coreutils-8.13/tests/init.cfg 2012-11-09 09:55:27.000000000 +0000 +@@ -130,6 +130,12 @@ + skip_ 'strace -qe "'"$1"'" does not work' + } + ++# Skip the current test if valgrind doesn't work. ++require_valgrind_() ++{ ++ valgrind --help >/dev/null || skip_ "requires valgrind" ++} ++ + # Require a controlling input `terminal'. + require_controlling_input_terminal_() + { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/misc/sort coreutils-8.13/tests/misc/sort +--- coreutils-8.13~/tests/misc/sort 2011-07-28 11:38:27.000000000 +0100 ++++ coreutils-8.13/tests/misc/sort 2012-11-09 09:53:52.000000000 +0000 +@@ -227,6 +227,21 @@ + ["15d", '-i -u', {IN=>"\1a\na\n"}, {OUT=>"\1a\n"}], + ["15e", '-i -u', {IN=>"a\n\1\1\1\1\1a\1\1\1\1\n"}, {OUT=>"a\n"}], + ++# This would fail (printing only the 7) for 8.6..8.18. ++# Use --parallel=1 for reproducibility, and a small buffer size ++# to let us trigger the problem with a smaller input. ++["unique-1", '--p=1 -S32b -u', {IN=>"7\n"x11 . "1\n"}, {OUT=>"1\n7\n"}], ++# Demonstrate that 8.19's key-spec-adjusting code is required. ++# These are more finicky in that they are arch-dependent. ++["unique-key-i686", '-u -k2,2 --p=1 -S32b', ++ {IN=>"a 7\n"x10 . "b 1\n"}, {OUT=>"b 1\na 7\n"}], ++["unique-key-x86_64", '-u -k2,2 --p=1 -S32b', ++ {IN=>"a 7\n"x11 . "b 1\n"}, {OUT=>"b 1\na 7\n"}], ++# Before 8.19, this would trigger a free-memory read. ++["unique-free-mem-read", '-u --p=1 -S32b', ++ {IN=>"a\n"."b"x900 ."\n"}, ++ {OUT=>"a\n"."b"x900 ."\n"}], ++ + # From Erick Branderhorst -- fixed around 1.19e + ["16a", '-f', + {IN=>"éminence\nüberhaupt\n's-Gravenhage\naëroclub\nAag\naagtappels\n"}, +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' coreutils-8.13~/tests/misc/sort-u-FMR coreutils-8.13/tests/misc/sort-u-FMR +--- coreutils-8.13~/tests/misc/sort-u-FMR 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.13/tests/misc/sort-u-FMR 2012-11-09 09:56:40.000000000 +0000 +@@ -0,0 +1,29 @@ ++#!/bin/sh ++# Before 8.19, this would trigger a free-memory read. ++ ++# Copyright (C) 2012 Free Software Foundation, Inc. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../src ++print_ver_ sort ++require_valgrind_ ++ ++{ echo 0; printf '%0900d\n' 1; } > in || framework_failure_ ++ ++valgrind --error-exitcode=1 sort --p=1 -S32b -u in > out || true # fail=1 ++ ++compare in out || fail=1 ++ ++Exit $fail --- coreutils-8.13.orig/debian/patches/80_fedora_sysinfo.dpatch +++ coreutils-8.13/debian/patches/80_fedora_sysinfo.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ +--- a/src/uname.c ++++ b/src/uname.c +@@ -260,7 +260,7 @@ + int + main (int argc, char **argv) + { +- static char const unknown[] = "unknown"; ++ static char unknown[] = "unknown"; + + /* Mask indicating which elements to print. */ + unsigned int toprint = 0; +@@ -301,13 +301,35 @@ + + if (toprint & PRINT_PROCESSOR) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_ARCHITECTURE + { + static char processor[257]; + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) + element = processor; + } ++#else ++ { ++ struct utsname u; ++ uname(&u); ++ element = u.machine; ++#ifdef linux ++ if(!strcmp(element, "i686")) { /* Check for Athlon */ ++ char cinfo[1024]; ++ FILE *f=fopen("/proc/cpuinfo", "r"); ++ if(f) { ++ while(fgets(cinfo, 1024, f)) { ++ if(!strncmp(cinfo, "vendor_id", 9)) { ++ if(strstr(cinfo, "AuthenticAMD")) ++ element="athlon"; ++ break; ++ } ++ } ++ fclose(f); ++ } ++ } ++#endif ++ } + #endif + #ifdef UNAME_PROCESSOR + if (element == unknown) +@@ -345,7 +367,7 @@ + + if (toprint & PRINT_HARDWARE_PLATFORM) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_PLATFORM + { + static char hardware_platform[257]; +@@ -353,6 +375,14 @@ + hardware_platform, sizeof hardware_platform)) + element = hardware_platform; + } ++#else ++ { ++ struct utsname u; ++ uname(&u); ++ element = u.machine; ++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6') ++ element[1]='3'; ++ } + #endif + #ifdef UNAME_HARDWARE_PLATFORM + if (element == unknown)