From 1e206d4651a971c98fb04fd209a400d230aef8f71801ac501f67ff4cca8c71cd Mon Sep 17 00:00:00 2001 From: Philipp Thomas Date: Thu, 10 Jan 2013 20:37:13 +0000 Subject: [PATCH 1/4] - Hardcode the name passed to find_lang so that it works for coreutils-testsuite too. - Don't call autoreconf on distributions older then 12.0 because their autoconf is too old. - Update default posix version to 200112 (bnc#783352). - Add coreutils-df-always-hide-rootfs.patch: Hide rootfs in df (df not using yet /proc/self/mountinfo). - Statically link to gmp otherwise expr depends on gmp and gmp configure script depends on expr which creates a build cycle. - Add the missing parts in coreutil.spec so that the testsuite is only run when coreutils-testsuite is built. Also add additional BuildRequires for the testsuite. - Hardcode the name passed to find_lang so that it works for coreutils-testsuite too. - Don't call autoreconf on distributions older then 12.0 because their autoconf is too old. OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=171 --- coreutils-8.6-compile-su-with-fpie.diff | 10 +++--- ...in-etc-default-su-resp-etc-login.defs.diff | 36 +++++++++++++------ coreutils-testsuite.changes | 33 +++++++++++++++++ coreutils-testsuite.spec | 15 +++++--- coreutils.changes | 13 +++++++ coreutils.spec | 8 +++-- 6 files changed, 93 insertions(+), 22 deletions(-) diff --git a/coreutils-8.6-compile-su-with-fpie.diff b/coreutils-8.6-compile-su-with-fpie.diff index f7e0b56..370dd6a 100644 --- a/coreutils-8.6-compile-su-with-fpie.diff +++ b/coreutils-8.6-compile-su-with-fpie.diff @@ -6,12 +6,12 @@ Subject: [PATCH 7/7] compile su with -fpie --- lib/Makefile.am | 2 +- src/Makefile.am | 5 +++++ - 2 files changed, 6 insertions(+), 1 deletions(-) + 2 files changed, 6 insertions(+), 1 deletion(-) Index: lib/Makefile.am =================================================================== ---- lib/Makefile.am.orig 2012-04-16 13:18:02.444819167 +0200 -+++ lib/Makefile.am 2012-04-16 13:18:07.729692419 +0200 +--- lib/Makefile.am.orig 2012-03-24 19:22:13.000000000 +0100 ++++ lib/Makefile.am 2013-01-10 13:24:08.147010847 +0100 @@ -28,7 +28,7 @@ noinst_LIBRARIES = include gnulib.mk @@ -23,8 +23,8 @@ Index: lib/Makefile.am buffer-lcm.c buffer-lcm.h Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2012-04-16 13:18:07.714692779 +0200 -+++ src/Makefile.am 2012-04-16 13:18:07.730692395 +0200 +--- src/Makefile.am.orig 2013-01-10 13:18:47.278685407 +0100 ++++ src/Makefile.am 2013-01-10 13:24:08.148010823 +0100 @@ -361,6 +361,11 @@ uptime_LDADD += $(GETLOADAVG_LIBS) su_SOURCES = su.c getdef.c su_LDADD += $(LIB_CRYPT) $(PAM_LIBS) diff --git a/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff b/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff index 9498bd0..88f6c1e 100644 --- a/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff +++ b/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff @@ -4,18 +4,19 @@ Date: Mon, 9 Aug 2010 16:03:12 +0200 Subject: [PATCH 5/7] honor settings in /etc/default/su resp /etc/login.defs --- - src/Makefile.am | 1 + - src/getdef.c | 259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/Makefile.am | 1 + src/Makefile.in | 4 + src/getdef.c | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/getdef.h | 29 ++++++ - src/su.c | 13 +++- - 4 files changed, 300 insertions(+), 2 deletions(-) + src/su.c | 13 ++ + 5 files changed, 302 insertions(+), 4 deletions(-) create mode 100644 src/getdef.c create mode 100644 src/getdef.h Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2012-04-16 13:18:07.682693547 +0200 -+++ src/Makefile.am 2012-04-16 13:18:34.609047413 +0200 +--- src/Makefile.am.orig 2013-01-10 13:18:47.251686056 +0100 ++++ src/Makefile.am 2013-01-10 13:18:47.278685407 +0100 @@ -358,6 +358,7 @@ factor_LDADD += $(LIB_GMP) uptime_LDADD += $(GETLOADAVG_LIBS) @@ -24,10 +25,25 @@ Index: src/Makefile.am su_LDADD += $(LIB_CRYPT) $(PAM_LIBS) # for various ACL functions +Index: src/Makefile.in +=================================================================== +--- src/Makefile.in.orig 2012-05-10 19:42:28.000000000 +0200 ++++ src/Makefile.in 2013-01-10 13:20:27.447278185 +0100 +@@ -592,8 +592,8 @@ stdbuf_DEPENDENCIES = $(am__DEPENDENCIES + stty_SOURCES = stty.c + stty_OBJECTS = stty.$(OBJEXT) + stty_DEPENDENCIES = $(am__DEPENDENCIES_2) +-su_SOURCES = su.c +-su_OBJECTS = su.$(OBJEXT) ++su_SOURCES = su.c getdef.c ++su_OBJECTS = su.$(OBJEXT) getdef.$(OBJEXT) + su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) + sum_SOURCES = sum.c + sum_OBJECTS = sum.$(OBJEXT) Index: src/getdef.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.c 2012-04-16 13:18:07.714692779 +0200 ++++ src/getdef.c 2013-01-10 13:18:47.279685382 +0100 @@ -0,0 +1,259 @@ +/* Copyright (C) 2003, 2004, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -291,7 +307,7 @@ Index: src/getdef.c Index: src/getdef.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.h 2012-04-16 13:18:07.714692779 +0200 ++++ src/getdef.h 2013-01-10 13:18:47.279685382 +0100 @@ -0,0 +1,29 @@ +/* Copyright (C) 2003, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -324,8 +340,8 @@ Index: src/getdef.h +#endif /* _GETDEF_H_ */ Index: src/su.c =================================================================== ---- src/su.c.orig 2012-04-16 13:18:07.706692971 +0200 -+++ src/su.c 2012-04-16 13:18:34.630046909 +0200 +--- src/su.c.orig 2013-01-10 13:18:47.272685552 +0100 ++++ src/su.c 2013-01-10 13:18:47.279685382 +0100 @@ -111,6 +111,8 @@ # include #endif diff --git a/coreutils-testsuite.changes b/coreutils-testsuite.changes index 58949ec..b428663 100644 --- a/coreutils-testsuite.changes +++ b/coreutils-testsuite.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Thu Jan 10 21:18:52 CET 2013 - phisama@suse.de + +- Hardcode the name passed to find_lang so that it works for + coreutils-testsuite too. + +------------------------------------------------------------------- +Thu Jan 10 11:58:17 CET 2013 - pth@suse.de + +- Don't call autoreconf on distributions older then 12.0 + because their autoconf is too old, so also patch Makefile.in + in addition to Makefile.am where needed. + +------------------------------------------------------------------- +Tue Dec 4 08:16:35 UTC 2012 - mail@bernhard-voelker.de + +- Update default posix version to 200112 (bnc#783352). +- Add coreutils-df-always-hide-rootfs.patch: + Hide rootfs in df (df not using yet /proc/self/mountinfo). + +------------------------------------------------------------------- +Mon Nov 19 13:04:44 UTC 2012 - idonmez@suse.com + +- Statically link to gmp otherwise expr depends on gmp and gmp + configure script depends on expr which creates a build cycle. + +------------------------------------------------------------------- +Thu Nov 8 13:12:25 CET 2012 - pth@suse.de + +- Add the missing parts in coreutil.spec so that the testsuite is + only run when coreutils-testsuite is built. Also add additional + BuildRequires for the testsuite. + ------------------------------------------------------------------- Tue Nov 6 13:23:45 CET 2012 - pth@suse.de diff --git a/coreutils-testsuite.spec b/coreutils-testsuite.spec index e513d92..2f5861d 100644 --- a/coreutils-testsuite.spec +++ b/coreutils-testsuite.spec @@ -1,7 +1,7 @@ # # spec file for package coreutils-testsuite # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -82,6 +82,7 @@ Patch36: coreutils-basename_documentation.patch Patch37: coreutils-bnc#697897-setsid.patch Patch38: coreutils-cp-corrupt-fragmented-sparse.patch Patch39: coreutils-no_silent-rule.patch +Patch40: coreutils-df-always-hide-rootfs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # this will create a cycle, broken up randomly - coreutils is just too core to have other # prerequires @@ -129,17 +130,23 @@ uname unexpand uniq unlink uptime users vdir wc who whoami yes %if 0%{suse_version} < 1200 %patch39 %endif +%patch40 -p1 xz -dc %{S:4} >po/de.po +# We need to statically link to gmp, otherwise we have a build loop +sed -i s,'$(LIB_GMP)',%{_libdir}/libgmp.a,g src/Makefile.am + %build +%if 0%{suse_version} >= 1200 AUTOPOINT=true autoreconf -fi +%endif export CFLAGS="%optflags -Wall" %configure --libexecdir=%{_libdir} --without-included-regex \ --enable-install-program=arch,su \ gl_cv_func_printf_directive_n=yes \ gl_cv_func_isnanl_works=yes \ - DEFAULT_POSIX2_VERSION=199209 + DEFAULT_POSIX2_VERSION=200112 alternative=199209 make -C po update-po make %{?_smp_mflags} V=1 @@ -166,7 +173,7 @@ install -m 644 %{S:1} %{buildroot}/etc/pam.d/su-l install -d -m 755 %{buildroot}/etc/default install -m 644 %{S:2} %{buildroot}/etc/default/su echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 -%find_lang %name +%find_lang coreutils %post %install_info --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz @@ -195,7 +202,7 @@ echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %doc %{_mandir}/man1/*.1.gz %dir %{_prefix}/share/locale/*/LC_TIME -%files lang -f %name.lang +%files lang -f coreutils.lang %defattr(-,root,root) %changelog diff --git a/coreutils.changes b/coreutils.changes index 2afb598..b428663 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Jan 10 21:18:52 CET 2013 - phisama@suse.de + +- Hardcode the name passed to find_lang so that it works for + coreutils-testsuite too. + +------------------------------------------------------------------- +Thu Jan 10 11:58:17 CET 2013 - pth@suse.de + +- Don't call autoreconf on distributions older then 12.0 + because their autoconf is too old, so also patch Makefile.in + in addition to Makefile.am where needed. + ------------------------------------------------------------------- Tue Dec 4 08:16:35 UTC 2012 - mail@bernhard-voelker.de diff --git a/coreutils.spec b/coreutils.spec index 5d99f4b..b7a57ec 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ # # spec file for package coreutils # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -138,7 +138,9 @@ xz -dc %{S:4} >po/de.po sed -i s,'$(LIB_GMP)',%{_libdir}/libgmp.a,g src/Makefile.am %build +%if 0%{suse_version} >= 1200 AUTOPOINT=true autoreconf -fi +%endif export CFLAGS="%optflags -Wall" %configure --libexecdir=%{_libdir} --without-included-regex \ --enable-install-program=arch,su \ @@ -171,7 +173,7 @@ install -m 644 %{S:1} %{buildroot}/etc/pam.d/su-l install -d -m 755 %{buildroot}/etc/default install -m 644 %{S:2} %{buildroot}/etc/default/su echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 -%find_lang %name +%find_lang coreutils %post %install_info --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz @@ -200,7 +202,7 @@ echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %doc %{_mandir}/man1/*.1.gz %dir %{_prefix}/share/locale/*/LC_TIME -%files lang -f %name.lang +%files lang -f coreutils.lang %defattr(-,root,root) %changelog From 26558dd00977cc98d21c2543393e30bcb74c003cf4e39d293eb66f623d8217d4 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 16 Jan 2013 19:09:57 +0000 Subject: [PATCH 2/4] - Avoid segmentation fault in "uniq" with long line input (bnc#796243, VUL-1) * src/cut.c: Instead of usig unreliable alloca() stack allocation, use heap allocation via xmalloc()+free(). (coreutils-i18n.patch) - Fix test-suite errors (bnc#798261). * tests/cp/fiemap-FMR: Fix path to src directory and declare require_valgrind_ function. (coreutils-cp-corrupt-fragmented-sparse.patch) * tests/misc/cut: Fix src/cut.c to properly pass output-delimiter tests. Synchronize cut.c related part of the i18n patch with Fedora's. Merge coreutils-i18n-infloop.patch into coreutils-i18n.patch. Merge coreutils-i18n-uninit.patch into coreutils-i18n.patch. In tests/misc/cut, do not replace the non-i18n error messages. (coreutils-i18n.patch) * tests/rm/ext3-perf: This test failed due to heavy parallel CPU and/or disk load because it is based on timeouts. Do not run the test-suite with 'make -jN. (coreutils.spec, coreutils-testsuite.spec) * Further spec changes: Run more tests: also run "very expensive" tests; add acl, python-pyinotify, strace and valgrind to the build requirements. Remove patch5 and patch6 as they are now merged into coreutils-i18n.patch (see above). (coreutils.spec, coreutils-testsuite.spec) - Maintenance changes: (coreutils.spec, coreutils-testsuite.spec) * Add perl and texinfo to the build requirements as they are needed to re-generate the man pages and the texinfo documentation. * Remove already-active "-Wall" compiler option from CFLAGS variable. * Install the compressed test-suite.log into the documentation directory of the coreutils-testsuite package (section %check and %files). * Properly guard the spec sections for the coreutils and the coreutils-testsuite package. * Update patches to reflect new line numbers. OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=172 --- coreutils-8.6-compile-su-with-fpie.diff | 8 +- ...in-etc-default-su-resp-etc-login.defs.diff | 20 +- coreutils-8.6-log-all-su-attempts.diff | 11 +- ...e-sure-sbin-resp-usr-sbin-are-in-PATH.diff | 4 +- coreutils-8.6-pam-support-for-su.diff | 12 +- coreutils-8.6-set-sane-default-path.diff | 11 +- coreutils-8.6-update-man-page-for-pam.diff | 8 +- coreutils-8.9-singlethreaded-sort.patch | 2 +- coreutils-acl-nofollow.patch | 18 +- coreutils-basename_documentation.patch | 6 +- coreutils-bnc#697897-setsid.patch | 12 +- coreutils-cp-corrupt-fragmented-sparse.patch | 14 +- coreutils-getaddrinfo.patch | 4 +- coreutils-gl_printf_safe.patch | 6 +- coreutils-i18n-infloop.patch | 14 -- coreutils-i18n-uninit.patch | 16 -- coreutils-i18n.patch | 173 +++++++++++------- coreutils-invalid-ids.patch | 4 +- coreutils-misc.patch | 12 +- coreutils-ptr_int_casts.patch | 4 +- coreutils-remove_hostname_documentation.patch | 20 +- coreutils-sysinfo.patch | 4 +- coreutils-testsuite.changes | 44 +++++ coreutils-testsuite.spec | 46 ++++- coreutils.changes | 44 +++++ coreutils.spec | 46 ++++- 26 files changed, 364 insertions(+), 199 deletions(-) delete mode 100644 coreutils-i18n-infloop.patch delete mode 100644 coreutils-i18n-uninit.patch diff --git a/coreutils-8.6-compile-su-with-fpie.diff b/coreutils-8.6-compile-su-with-fpie.diff index 370dd6a..f113b77 100644 --- a/coreutils-8.6-compile-su-with-fpie.diff +++ b/coreutils-8.6-compile-su-with-fpie.diff @@ -10,8 +10,8 @@ Subject: [PATCH 7/7] compile su with -fpie Index: lib/Makefile.am =================================================================== ---- lib/Makefile.am.orig 2012-03-24 19:22:13.000000000 +0100 -+++ lib/Makefile.am 2013-01-10 13:24:08.147010847 +0100 +--- lib/Makefile.am.orig ++++ lib/Makefile.am @@ -28,7 +28,7 @@ noinst_LIBRARIES = include gnulib.mk @@ -23,8 +23,8 @@ Index: lib/Makefile.am buffer-lcm.c buffer-lcm.h Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2013-01-10 13:18:47.278685407 +0100 -+++ src/Makefile.am 2013-01-10 13:24:08.148010823 +0100 +--- src/Makefile.am.orig ++++ src/Makefile.am @@ -361,6 +361,11 @@ uptime_LDADD += $(GETLOADAVG_LIBS) su_SOURCES = su.c getdef.c su_LDADD += $(LIB_CRYPT) $(PAM_LIBS) diff --git a/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff b/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff index 88f6c1e..17e2c21 100644 --- a/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff +++ b/coreutils-8.6-honor-settings-in-etc-default-su-resp-etc-login.defs.diff @@ -15,8 +15,8 @@ Subject: [PATCH 5/7] honor settings in /etc/default/su resp /etc/login.defs Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2013-01-10 13:18:47.251686056 +0100 -+++ src/Makefile.am 2013-01-10 13:18:47.278685407 +0100 +--- src/Makefile.am.orig ++++ src/Makefile.am @@ -358,6 +358,7 @@ factor_LDADD += $(LIB_GMP) uptime_LDADD += $(GETLOADAVG_LIBS) @@ -27,8 +27,8 @@ Index: src/Makefile.am # for various ACL functions Index: src/Makefile.in =================================================================== ---- src/Makefile.in.orig 2012-05-10 19:42:28.000000000 +0200 -+++ src/Makefile.in 2013-01-10 13:20:27.447278185 +0100 +--- src/Makefile.in.orig ++++ src/Makefile.in @@ -592,8 +592,8 @@ stdbuf_DEPENDENCIES = $(am__DEPENDENCIES stty_SOURCES = stty.c stty_OBJECTS = stty.$(OBJEXT) @@ -42,8 +42,8 @@ Index: src/Makefile.in sum_OBJECTS = sum.$(OBJEXT) Index: src/getdef.c =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.c 2013-01-10 13:18:47.279685382 +0100 +--- /dev/null ++++ src/getdef.c @@ -0,0 +1,259 @@ +/* Copyright (C) 2003, 2004, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -306,8 +306,8 @@ Index: src/getdef.c +#endif Index: src/getdef.h =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.h 2013-01-10 13:18:47.279685382 +0100 +--- /dev/null ++++ src/getdef.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2003, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -340,8 +340,8 @@ Index: src/getdef.h +#endif /* _GETDEF_H_ */ Index: src/su.c =================================================================== ---- src/su.c.orig 2013-01-10 13:18:47.272685552 +0100 -+++ src/su.c 2013-01-10 13:18:47.279685382 +0100 +--- src/su.c.orig ++++ src/su.c @@ -111,6 +111,8 @@ # include #endif diff --git a/coreutils-8.6-log-all-su-attempts.diff b/coreutils-8.6-log-all-su-attempts.diff index 492bc06..d2c9c53 100644 --- a/coreutils-8.6-log-all-su-attempts.diff +++ b/coreutils-8.6-log-all-su-attempts.diff @@ -7,10 +7,10 @@ Subject: [PATCH 3/7] log all su attempts src/su.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) -diff --git a/src/su.c b/src/su.c -index 1d3d007..2a9e423 100644 ---- a/src/su.c -+++ b/src/su.c +Index: coreutils-8.17/src/su.c +=================================================================== +--- coreutils-8.17.orig/src/su.c ++++ coreutils-8.17/src/su.c @@ -75,6 +75,9 @@ #if HAVE_SYSLOG_H && HAVE_SYSLOG @@ -21,6 +21,3 @@ index 1d3d007..2a9e423 100644 #else # undef SYSLOG_SUCCESS # undef SYSLOG_FAILURE --- -1.7.1 - diff --git a/coreutils-8.6-make-sure-sbin-resp-usr-sbin-are-in-PATH.diff b/coreutils-8.6-make-sure-sbin-resp-usr-sbin-are-in-PATH.diff index 253ae15..c74e496 100644 --- a/coreutils-8.6-make-sure-sbin-resp-usr-sbin-are-in-PATH.diff +++ b/coreutils-8.6-make-sure-sbin-resp-usr-sbin-are-in-PATH.diff @@ -9,8 +9,8 @@ Subject: [PATCH 6/7] make sure /sbin resp /usr/sbin are in PATH Index: src/su.c =================================================================== ---- src/su.c.orig 2012-04-16 13:00:25.489424170 +0200 -+++ src/su.c 2012-04-16 13:01:12.161193827 +0200 +--- src/su.c.orig ++++ src/su.c @@ -458,6 +458,117 @@ correct_password (const struct passwd *p #endif /* !USE_PAM */ } diff --git a/coreutils-8.6-pam-support-for-su.diff b/coreutils-8.6-pam-support-for-su.diff index e79da52..f45e733 100644 --- a/coreutils-8.6-pam-support-for-su.diff +++ b/coreutils-8.6-pam-support-for-su.diff @@ -11,8 +11,8 @@ Subject: [PATCH 1/7] pam support for su Index: configure.ac =================================================================== ---- configure.ac.orig 2012-03-24 19:22:13.000000000 +0100 -+++ configure.ac 2012-04-16 12:59:28.737919405 +0200 +--- configure.ac.orig ++++ configure.ac @@ -185,6 +185,20 @@ fi AC_FUNC_FORK @@ -36,8 +36,8 @@ Index: configure.ac gl_ADD_PROG([optional_bin_progs], [chroot])) Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2012-03-24 19:22:13.000000000 +0100 -+++ src/Makefile.am 2012-04-16 12:59:28.737919405 +0200 +--- src/Makefile.am.orig ++++ src/Makefile.am @@ -357,8 +357,8 @@ factor_LDADD += $(LIB_GMP) # for getloadavg uptime_LDADD += $(GETLOADAVG_LIBS) @@ -51,8 +51,8 @@ Index: src/Makefile.am copy_LDADD += $(LIB_ACL) Index: src/su.c =================================================================== ---- src/su.c.orig 2012-03-24 19:22:13.000000000 +0100 -+++ src/su.c 2012-04-16 13:00:06.496924665 +0200 +--- src/su.c.orig ++++ src/su.c @@ -37,6 +37,16 @@ restricts who can su to UID 0 accounts. RMS considers that to be fascist. diff --git a/coreutils-8.6-set-sane-default-path.diff b/coreutils-8.6-set-sane-default-path.diff index d0604db..fbde488 100644 --- a/coreutils-8.6-set-sane-default-path.diff +++ b/coreutils-8.6-set-sane-default-path.diff @@ -7,10 +7,10 @@ Subject: [PATCH 4/7] set sane default path src/su.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-) -diff --git a/src/su.c b/src/su.c -index 2a9e423..0071622 100644 ---- a/src/su.c -+++ b/src/su.c +Index: coreutils-8.17/src/su.c +=================================================================== +--- coreutils-8.17.orig/src/su.c ++++ coreutils-8.17/src/su.c @@ -112,18 +112,10 @@ #endif @@ -32,6 +32,3 @@ index 2a9e423..0071622 100644 /* The shell to run if none is given in the user's passwd entry. */ #define DEFAULT_SHELL "/bin/sh" --- -1.7.1 - diff --git a/coreutils-8.6-update-man-page-for-pam.diff b/coreutils-8.6-update-man-page-for-pam.diff index e512c7f..892582d 100644 --- a/coreutils-8.6-update-man-page-for-pam.diff +++ b/coreutils-8.6-update-man-page-for-pam.diff @@ -9,9 +9,9 @@ Subject: [PATCH 2/7] update man page for pam Index: doc/coreutils.texi =================================================================== ---- doc/coreutils.texi.orig 2012-04-16 13:18:07.651694291 +0200 -+++ doc/coreutils.texi 2012-04-16 13:18:14.825522204 +0200 -@@ -15796,8 +15796,11 @@ to certain shells, etc.). +--- doc/coreutils.texi.orig ++++ doc/coreutils.texi +@@ -15806,8 +15806,11 @@ to certain shells, etc.). @findex syslog @command{su} can optionally be compiled to use @code{syslog} to report failed, and optionally successful, @command{su} attempts. (If the system @@ -25,7 +25,7 @@ Index: doc/coreutils.texi The program accepts the following options. Also see @ref{Common options}. -@@ -15878,33 +15881,6 @@ Exit status: +@@ -15888,33 +15891,6 @@ Exit status: the exit status of the subshell otherwise @end display diff --git a/coreutils-8.9-singlethreaded-sort.patch b/coreutils-8.9-singlethreaded-sort.patch index 9bf7857..e443c30 100644 --- a/coreutils-8.9-singlethreaded-sort.patch +++ b/coreutils-8.9-singlethreaded-sort.patch @@ -2,7 +2,7 @@ Index: src/sort.c =================================================================== --- src/sort.c.orig +++ src/sort.c -@@ -5288,7 +5288,11 @@ main (int argc, char **argv) +@@ -5286,7 +5286,11 @@ main (int argc, char **argv) { if (!nthreads) { diff --git a/coreutils-acl-nofollow.patch b/coreutils-acl-nofollow.patch index 04418d2..475d4df 100644 --- a/coreutils-acl-nofollow.patch +++ b/coreutils-acl-nofollow.patch @@ -12,8 +12,8 @@ Date: Fri Jul 22 14:48:42 2011 +0200 Index: lib/acl-internal.h =================================================================== ---- lib/acl-internal.h.orig 2012-03-09 08:31:00.000000000 +0100 -+++ lib/acl-internal.h 2012-04-16 13:17:12.470016537 +0200 +--- lib/acl-internal.h.orig ++++ lib/acl-internal.h @@ -142,6 +142,12 @@ rpl_acl_set_fd (int fd, acl_t acl) # endif @@ -29,8 +29,8 @@ Index: lib/acl-internal.h # define acl_from_mode(mode) (NULL) Index: lib/file-has-acl.c =================================================================== ---- lib/file-has-acl.c.orig 2012-03-09 08:31:00.000000000 +0100 -+++ lib/file-has-acl.c 2012-04-16 13:17:12.471016513 +0200 +--- lib/file-has-acl.c.orig ++++ lib/file-has-acl.c @@ -492,12 +492,20 @@ file_has_acl (char const *name, struct s /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ int ret; @@ -55,8 +55,8 @@ Index: lib/file-has-acl.c { Index: m4/acl.m4 =================================================================== ---- m4/acl.m4.orig 2012-01-06 10:14:31.000000000 +0100 -+++ m4/acl.m4 2012-04-16 13:17:12.471016513 +0200 +--- m4/acl.m4.orig ++++ m4/acl.m4 @@ -33,7 +33,7 @@ AC_DEFUN([gl_FUNC_ACL], AC_CHECK_FUNCS( [acl_get_file acl_get_fd acl_set_file acl_set_fd \ @@ -68,9 +68,9 @@ Index: m4/acl.m4 acl_to_short_text acl_free_text]) Index: ChangeLog =================================================================== ---- ChangeLog.orig 2012-03-26 14:15:03.000000000 +0200 -+++ ChangeLog 2012-04-16 13:17:12.474016441 +0200 -@@ -2815,6 +2815,14 @@ +--- ChangeLog.orig ++++ ChangeLog +@@ -3272,6 +3272,14 @@ MacOS X 10.7 has an fdatasync that is not declared, and is rumored to be ineffective. (Bug#9141) diff --git a/coreutils-basename_documentation.patch b/coreutils-basename_documentation.patch index b73b9e8..e8f59fa 100644 --- a/coreutils-basename_documentation.patch +++ b/coreutils-basename_documentation.patch @@ -1,8 +1,8 @@ Index: doc/coreutils.texi =================================================================== ---- doc/coreutils.texi.orig 2012-04-16 13:12:04.624344318 +0200 -+++ doc/coreutils.texi 2012-04-16 13:13:08.231837183 +0200 -@@ -12447,6 +12447,16 @@ This section describes commands that man +--- doc/coreutils.texi.orig ++++ doc/coreutils.texi +@@ -12457,6 +12457,16 @@ This section describes commands that man @command{basename} removes any leading directory components from @var{name}. Synopsis: diff --git a/coreutils-bnc#697897-setsid.patch b/coreutils-bnc#697897-setsid.patch index b66c090..81f1681 100644 --- a/coreutils-bnc#697897-setsid.patch +++ b/coreutils-bnc#697897-setsid.patch @@ -1,8 +1,8 @@ Index: doc/coreutils.info =================================================================== ---- doc/coreutils.info.orig 2012-03-26 14:08:30.000000000 +0200 -+++ doc/coreutils.info 2012-04-18 11:17:09.917545246 +0200 -@@ -12788,6 +12788,10 @@ and optionally successful, `su' attempts +--- doc/coreutils.info.orig ++++ doc/coreutils.info +@@ -12796,6 +12796,10 @@ and optionally successful, `su' attempts `syslog'.) However, GNU `su' does not check if the user is a member of the `wheel' group; see below. @@ -13,7 +13,7 @@ Index: doc/coreutils.info The program accepts the following options. Also see *note Common options::. -@@ -12796,6 +12800,12 @@ options::. +@@ -12804,6 +12808,12 @@ options::. Pass COMMAND, a single command line to run, to the shell with a `-c' option instead of starting an interactive shell. @@ -28,8 +28,8 @@ Index: doc/coreutils.info Pass the `-f' option to the shell. This probably only makes sense Index: src/su.c =================================================================== ---- src/su.c.orig 2012-04-18 11:17:09.856546407 +0200 -+++ src/su.c 2012-04-18 11:17:09.917545246 +0200 +--- src/su.c.orig ++++ src/su.c @@ -141,6 +141,9 @@ static bool simulate_login; /* If true, change some environment vars to indicate the user su'd to. */ static bool change_environment; diff --git a/coreutils-cp-corrupt-fragmented-sparse.patch b/coreutils-cp-corrupt-fragmented-sparse.patch index 2eb4d46..2310787 100644 --- a/coreutils-cp-corrupt-fragmented-sparse.patch +++ b/coreutils-cp-corrupt-fragmented-sparse.patch @@ -53,7 +53,7 @@ Index: tests/cp/fiemap-FMR =================================================================== --- /dev/null +++ tests/cp/fiemap-FMR -@@ -0,0 +1,31 @@ +@@ -0,0 +1,41 @@ +#!/bin/sh +# Trigger a free-memory read bug in cp from coreutils-[8.11..8.19] + @@ -72,9 +72,19 @@ Index: tests/cp/fiemap-FMR +# 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 ++. "${srcdir=.}/init.sh"; path_prepend_ ../src +print_ver_ cp + ++# Skip the current test if valgrind doesn't work, ++# which could happen if not installed, ++# or hasn't support for the built architecture, ++# or hasn't appropriate error suppressions installed etc. ++require_valgrind_() ++{ ++ valgrind --error-exitcode=1 true 2>/dev/null || ++ skip_ "requires a working valgrind" ++} ++ +require_valgrind_ +require_perl_ +: ${PERL=perl} diff --git a/coreutils-getaddrinfo.patch b/coreutils-getaddrinfo.patch index 6028b1d..b71a324 100644 --- a/coreutils-getaddrinfo.patch +++ b/coreutils-getaddrinfo.patch @@ -1,7 +1,7 @@ Index: gnulib-tests/test-getaddrinfo.c =================================================================== ---- gnulib-tests/test-getaddrinfo.c.orig 2012-04-16 13:18:02.424819645 +0200 -+++ gnulib-tests/test-getaddrinfo.c 2012-04-16 13:18:07.737692228 +0200 +--- gnulib-tests/test-getaddrinfo.c.orig ++++ gnulib-tests/test-getaddrinfo.c @@ -86,11 +86,7 @@ simple (char const *host, char const *se the test merely because someone is down the country on their in-law's farm. */ diff --git a/coreutils-gl_printf_safe.patch b/coreutils-gl_printf_safe.patch index 8bcb3aa..a66b0d0 100644 --- a/coreutils-gl_printf_safe.patch +++ b/coreutils-gl_printf_safe.patch @@ -1,8 +1,8 @@ Index: m4/gnulib-comp.m4 =================================================================== ---- m4/gnulib-comp.m4.orig 2012-03-20 23:34:39.000000000 +0100 -+++ m4/gnulib-comp.m4 2012-04-16 12:57:23.373219154 +0200 -@@ -1584,7 +1584,6 @@ gl_POSIXTM +--- m4/gnulib-comp.m4.orig ++++ m4/gnulib-comp.m4 +@@ -1597,7 +1597,6 @@ gl_POSIXTM gl_POSIXVER gl_FUNC_PRINTF_FREXP gl_FUNC_PRINTF_FREXPL diff --git a/coreutils-i18n-infloop.patch b/coreutils-i18n-infloop.patch deleted file mode 100644 index 7632cec..0000000 --- a/coreutils-i18n-infloop.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: src/sort.c -=================================================================== ---- src/sort.c.orig 2012-04-16 13:23:11.726363043 +0200 -+++ src/sort.c 2012-04-16 13:23:20.474151036 +0200 -@@ -3161,7 +3161,8 @@ keycompare_mb (const struct line *a, con - if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ - STATE = state_bak; \ - if (!ignore) \ -- COPY[NEW_LEN++] = TEXT[i++]; \ -+ COPY[NEW_LEN++] = TEXT[i]; \ -+ i++; \ - continue; \ - } \ - \ diff --git a/coreutils-i18n-uninit.patch b/coreutils-i18n-uninit.patch deleted file mode 100644 index 1f0ffef..0000000 --- a/coreutils-i18n-uninit.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: src/cut.c -=================================================================== ---- src/cut.c.orig 2012-04-16 13:17:12.321020103 +0200 -+++ src/cut.c 2012-04-16 13:17:12.333019817 +0200 -@@ -869,7 +869,10 @@ cut_fields_mb (FILE *stream) - c = getc (stream); - empty_input = (c == EOF); - if (c != EOF) -- ungetc (c, stream); -+ { -+ ungetc (c, stream); -+ wc = 0; -+ } - else - wc = WEOF; - diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index 044310a..64e92dd 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -19,8 +19,8 @@ Index: lib/linebuffer.h =================================================================== ---- lib/linebuffer.h.orig 2012-01-06 10:14:31.000000000 +0100 -+++ lib/linebuffer.h 2012-06-19 12:13:47.369654318 +0200 +--- lib/linebuffer.h.orig ++++ lib/linebuffer.h @@ -21,6 +21,11 @@ # include @@ -45,8 +45,8 @@ Index: lib/linebuffer.h /* Initialize linebuffer LINEBUFFER for use. */ Index: src/cut.c =================================================================== ---- src/cut.c.orig 2012-05-02 10:31:47.000000000 +0200 -+++ src/cut.c 2012-06-19 12:13:47.370654294 +0200 +--- src/cut.c.orig ++++ src/cut.c @@ -28,6 +28,11 @@ #include #include @@ -136,7 +136,7 @@ Index: src/cut.c static size_t field_1_bufsize; -/* The largest field or byte index used as an endpoint of a closed -+/* The largest field, character or byte index used as an endpoint of a closed ++/* The largest byte, character or field index used as an endpoint of a closed or degenerate range specification; this doesn't include the starting index of right-open-ended ranges. For example, with either range spec '2-5,9-', '2-3,5,9-' this variable would be set to 5. */ @@ -247,7 +247,7 @@ Index: src/cut.c } max_range_endpoint = 0; -@@ -581,6 +663,63 @@ cut_bytes (FILE *stream) +@@ -581,6 +663,77 @@ cut_bytes (FILE *stream) } } @@ -271,7 +271,10 @@ Index: src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ ++ /* Whether to begin printing delimiters between ranges for the current line. ++ Set after we've begun printing data corresponding to the first range. */ ++ bool print_delimiter = false; + + idx = 0; + buflen = 0; @@ -294,12 +297,23 @@ Index: src/cut.c + { + putchar ('\n'); + idx = 0; ++ print_delimiter = false; + } + else + { ++ bool range_start; ++ bool *rs = output_delimiter_specified ? &range_start : NULL; + idx += (operating_mode == byte_mode) ? mblength : 1; -+ if (print_kth (idx, NULL)) -+ fwrite (bufpos, mblength, sizeof(char), stdout); ++ if (print_kth (idx, rs)) ++ { ++ if (rs && *rs && print_delimiter) ++ { ++ fwrite (output_delimiter_string, sizeof (char), ++ output_delimiter_length, stdout); ++ } ++ print_delimiter = true; ++ fwrite (bufpos, mblength, sizeof(char), stdout); ++ } + } + + buflen -= mblength; @@ -311,7 +325,7 @@ Index: src/cut.c /* Read from stream STREAM, printing to standard output any selected fields. */ static void -@@ -703,13 +842,192 @@ cut_fields (FILE *stream) +@@ -703,13 +856,195 @@ cut_fields (FILE *stream) } } @@ -331,7 +345,7 @@ Index: src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ + + found_any_selected_field = 0; + field_idx = 1; @@ -342,7 +356,10 @@ Index: src/cut.c + c = getc (stream); + empty_input = (c == EOF); + if (c != EOF) ++ { + ungetc (c, stream); ++ wc = 0; ++ } + else + wc = WEOF; + @@ -380,7 +397,7 @@ Index: src/cut.c + break; + } + -+ if (wc == WEOF) ++ if (len <= 0 && wc == WEOF) + break; + + /* If the first field extends to the end of line (it is not @@ -507,7 +524,7 @@ Index: src/cut.c } /* Process file FILE to standard output. -@@ -761,6 +1079,8 @@ main (int argc, char **argv) +@@ -761,6 +1096,8 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; char *spec_list_string IF_LINT ( = NULL); @@ -516,7 +533,7 @@ Index: src/cut.c initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -783,7 +1103,6 @@ main (int argc, char **argv) +@@ -783,7 +1120,6 @@ main (int argc, char **argv) switch (optc) { case 'b': @@ -524,7 +541,7 @@ Index: src/cut.c /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -791,6 +1110,14 @@ main (int argc, char **argv) +@@ -791,6 +1127,14 @@ main (int argc, char **argv) spec_list_string = optarg; break; @@ -539,7 +556,7 @@ Index: src/cut.c case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -802,10 +1129,35 @@ main (int argc, char **argv) +@@ -802,10 +1146,35 @@ main (int argc, char **argv) case 'd': /* New delimiter. */ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */ @@ -579,7 +596,7 @@ Index: src/cut.c break; case OUTPUT_DELIMITER_OPTION: -@@ -818,6 +1170,7 @@ main (int argc, char **argv) +@@ -818,6 +1187,7 @@ main (int argc, char **argv) break; case 'n': @@ -587,7 +604,7 @@ Index: src/cut.c break; case 's': -@@ -840,7 +1193,7 @@ main (int argc, char **argv) +@@ -840,7 +1210,7 @@ main (int argc, char **argv) if (operating_mode == undefined_mode) FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); @@ -596,7 +613,7 @@ Index: src/cut.c FATAL_ERROR (_("an input delimiter may be specified only\ when operating on fields")); -@@ -867,15 +1220,34 @@ main (int argc, char **argv) +@@ -867,15 +1237,34 @@ main (int argc, char **argv) } if (!delim_specified) @@ -639,8 +656,8 @@ Index: src/cut.c if (optind == argc) Index: src/expand.c =================================================================== ---- src/expand.c.orig 2012-05-01 22:55:08.000000000 +0200 -+++ src/expand.c 2012-06-19 12:13:47.370654294 +0200 +--- src/expand.c.orig ++++ src/expand.c @@ -37,12 +37,29 @@ #include #include @@ -830,8 +847,8 @@ Index: src/expand.c error (EXIT_FAILURE, errno, "-"); Index: src/fold.c =================================================================== ---- src/fold.c.orig 2012-04-29 13:45:30.000000000 +0200 -+++ src/fold.c 2012-06-19 12:13:47.370654294 +0200 +--- src/fold.c.orig ++++ src/fold.c @@ -22,12 +22,34 @@ #include #include @@ -1232,8 +1249,8 @@ Index: src/fold.c case 's': /* Break at word boundaries. */ Index: src/join.c =================================================================== ---- src/join.c.orig 2012-05-02 10:31:47.000000000 +0200 -+++ src/join.c 2012-06-19 12:13:47.371654270 +0200 +--- src/join.c.orig ++++ src/join.c @@ -22,18 +22,32 @@ #include #include @@ -1712,8 +1729,8 @@ Index: src/join.c case NOCHECK_ORDER_OPTION: Index: src/pr.c =================================================================== ---- src/pr.c.orig 2012-05-10 09:14:30.000000000 +0200 -+++ src/pr.c 2012-06-19 12:15:34.144102794 +0200 +--- src/pr.c.orig ++++ src/pr.c @@ -312,6 +312,32 @@ #include @@ -2438,8 +2455,8 @@ Index: src/pr.c Index: src/sort.c =================================================================== ---- src/sort.c.orig 2012-05-04 12:06:22.000000000 +0200 -+++ src/sort.c 2012-06-19 12:16:37.982577478 +0200 +--- src/sort.c.orig ++++ src/sort.c @@ -22,12 +22,21 @@ #include @@ -3115,7 +3132,7 @@ Index: src/sort.c else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2647,6 +3081,179 @@ keycompare (struct line const *a, struct +@@ -2647,6 +3081,180 @@ keycompare (struct line const *a, struct return key->reverse ? -diff : diff; } @@ -3197,7 +3214,8 @@ Index: src/sort.c + if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ + STATE = state_bak; \ + if (!ignore) \ -+ COPY[NEW_LEN++] = TEXT[i++]; \ ++ COPY[NEW_LEN++] = TEXT[i]; \ ++ i++; \ + continue; \ + } \ + \ @@ -3295,7 +3313,7 @@ Index: src/sort.c /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -4107,7 +4714,7 @@ main (int argc, char **argv) +@@ -4107,7 +4715,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3304,7 +3322,7 @@ Index: src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4128,6 +4735,29 @@ main (int argc, char **argv) +@@ -4128,6 +4736,29 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -3334,7 +3352,7 @@ Index: src/sort.c have_read_stdin = false; inittables (); -@@ -4398,13 +5028,34 @@ main (int argc, char **argv) +@@ -4398,13 +5029,34 @@ main (int argc, char **argv) case 't': { @@ -3373,7 +3391,7 @@ Index: src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4415,9 +5066,12 @@ main (int argc, char **argv) +@@ -4415,9 +5067,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3390,8 +3408,8 @@ Index: src/sort.c Index: src/unexpand.c =================================================================== ---- src/unexpand.c.orig 2012-05-01 22:55:08.000000000 +0200 -+++ src/unexpand.c 2012-06-19 12:13:47.373654222 +0200 +--- src/unexpand.c.orig ++++ src/unexpand.c @@ -38,12 +38,29 @@ #include #include @@ -3647,8 +3665,8 @@ Index: src/unexpand.c error (EXIT_FAILURE, errno, "-"); Index: src/uniq.c =================================================================== ---- src/uniq.c.orig 2012-05-01 22:55:08.000000000 +0200 -+++ src/uniq.c 2012-06-19 12:13:47.374654199 +0200 +--- src/uniq.c.orig ++++ src/uniq.c @@ -21,6 +21,16 @@ #include #include @@ -3800,7 +3818,7 @@ Index: src/uniq.c if (check_chars < oldlen) oldlen = check_chars; if (check_chars < newlen) -@@ -241,14 +346,92 @@ different (char *old, char *new, size_t +@@ -241,14 +346,100 @@ different (char *old, char *new, size_t if (ignore_case) { @@ -3808,14 +3826,19 @@ Index: src/uniq.c - return oldlen != newlen || memcasecmp (old, new, oldlen); + size_t i; + -+ copy_old = alloca (oldlen + 1); -+ copy_new = alloca (oldlen + 1); ++ copy_old = xmalloc (sizeof(char) * (oldlen + 1)); ++ copy_new = xmalloc (sizeof(char) * (oldlen + 1)); + + for (i = 0; i < oldlen; i++) + { + copy_old[i] = toupper (old[i]); + copy_new[i] = toupper (new[i]); + } ++ ++ bool rc = xmemcoll (copy_old, oldlen, copy_new, newlen); ++ free (copy_old); ++ free (copy_new); ++ return rc; } - else if (hard_LC_COLLATE) - return xmemcoll (old, oldlen, new, newlen) != 0; @@ -3851,7 +3874,7 @@ Index: src/uniq.c + + for (i = 0; i < 2; i++) + { -+ copy[i] = alloca (len[i] + 1); ++ copy[i] = xmalloc (sizeof(char) * (len[i] + 1)); + + for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) + { @@ -3892,13 +3915,16 @@ Index: src/uniq.c + len[i] = j; + } + -+ return xmemcoll (copy[0], len[0], copy[1], len[1]); ++ int rc = xmemcoll (copy[0], len[0], copy[1], len[1]); ++ free (copy[0]); ++ free (copy[1]); ++ return rc; } +#endif /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. -@@ -304,15 +487,43 @@ check_file (const char *infile, const ch +@@ -304,15 +495,43 @@ check_file (const char *infile, const ch { char *prevfield IF_LINT ( = NULL); size_t prevlen IF_LINT ( = 0); @@ -3942,7 +3968,7 @@ Index: src/uniq.c if (prevline->length == 0 || different (thisfield, prevfield, thislen, prevlen)) { -@@ -331,17 +542,26 @@ check_file (const char *infile, const ch +@@ -331,17 +550,26 @@ check_file (const char *infile, const ch size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -3969,7 +3995,7 @@ Index: src/uniq.c if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -350,6 +570,15 @@ check_file (const char *infile, const ch +@@ -350,6 +578,15 @@ check_file (const char *infile, const ch } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -3985,7 +4011,7 @@ Index: src/uniq.c match = !different (thisfield, prevfield, thislen, prevlen); match_count += match; -@@ -382,6 +611,9 @@ check_file (const char *infile, const ch +@@ -382,6 +619,9 @@ check_file (const char *infile, const ch SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3995,7 +4021,7 @@ Index: src/uniq.c if (!match) match_count = 0; } -@@ -427,6 +659,19 @@ main (int argc, char **argv) +@@ -427,6 +667,19 @@ main (int argc, char **argv) atexit (close_stdout); @@ -4017,8 +4043,8 @@ Index: src/uniq.c check_chars = SIZE_MAX; Index: tests/Makefile.am =================================================================== ---- tests/Makefile.am.orig 2012-05-10 16:36:42.000000000 +0200 -+++ tests/Makefile.am 2012-06-19 12:13:47.374654199 +0200 +--- tests/Makefile.am.orig ++++ tests/Makefile.am @@ -247,6 +247,7 @@ TESTS = \ misc/sort-debug-warn \ misc/sort-discrim \ @@ -4040,8 +4066,8 @@ Index: tests/Makefile.am pr/0FFnt \ Index: tests/misc/cut =================================================================== ---- tests/misc/cut.orig 2012-02-03 10:22:06.000000000 +0100 -+++ tests/misc/cut 2012-06-19 12:13:47.374654199 +0200 +--- tests/misc/cut.orig ++++ tests/misc/cut @@ -30,7 +30,7 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8}; my $prog = 'cut'; my $try = "Try '$prog --help' for more information.\n"; @@ -4060,10 +4086,31 @@ Index: tests/misc/cut ['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}], ['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}], ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, +@@ -176,13 +176,13 @@ if ($mb_locale ne 'C') + # non-MB: invalid byte or field list + # MB: invalid byte, character or field list + # Adjust the expected error output accordingly. +- if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} +- (@new_t)) +- { +- my $sub = {ERR_SUBST => 's/, character//'}; +- push @new_t, $sub; +- push @$t, $sub; +- } ++# if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++# (@new_t)) ++# { ++# my $sub = {ERR_SUBST => 's/, character//'}; ++# push @new_t, $sub; ++# push @$t, $sub; ++# } + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + } + push @Tests, @new; Index: tests/misc/mb1.I =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb1.I 2012-06-19 12:13:47.374654199 +0200 +--- /dev/null ++++ tests/misc/mb1.I @@ -0,0 +1,4 @@ +Apple@10 +Banana@5 @@ -4071,8 +4118,8 @@ Index: tests/misc/mb1.I +Cherry@30 Index: tests/misc/mb1.X =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb1.X 2012-06-19 12:13:47.374654199 +0200 +--- /dev/null ++++ tests/misc/mb1.X @@ -0,0 +1,4 @@ +Banana@5 +Apple@10 @@ -4080,8 +4127,8 @@ Index: tests/misc/mb1.X +Cherry@30 Index: tests/misc/mb2.I =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb2.I 2012-06-19 12:13:47.374654199 +0200 +--- /dev/null ++++ tests/misc/mb2.I @@ -0,0 +1,4 @@ +Apple@AA10@@20 +Banana@AA5@@30 @@ -4089,8 +4136,8 @@ Index: tests/misc/mb2.I +Cherry@AA30@@10 Index: tests/misc/mb2.X =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb2.X 2012-06-19 12:13:47.374654199 +0200 +--- /dev/null ++++ tests/misc/mb2.X @@ -0,0 +1,4 @@ +Citrus@AA20@@5 +Cherry@AA30@@10 @@ -4098,8 +4145,8 @@ Index: tests/misc/mb2.X +Banana@AA5@@30 Index: tests/misc/sort-mb-tests =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/sort-mb-tests 2012-06-19 12:13:47.375654176 +0200 +--- /dev/null ++++ tests/misc/sort-mb-tests @@ -0,0 +1,58 @@ +#! /bin/sh +case $# in diff --git a/coreutils-invalid-ids.patch b/coreutils-invalid-ids.patch index f491b05..8ecb1c0 100644 --- a/coreutils-invalid-ids.patch +++ b/coreutils-invalid-ids.patch @@ -13,8 +13,8 @@ Andreas Gruenbacher Index: src/chgrp.c =================================================================== ---- src/chgrp.c.orig 2012-03-24 19:22:13.000000000 +0100 -+++ src/chgrp.c 2012-04-16 13:22:03.004026462 +0200 +--- src/chgrp.c.orig ++++ src/chgrp.c @@ -88,7 +88,7 @@ parse_group (const char *name) { unsigned long int tmp; diff --git a/coreutils-misc.patch b/coreutils-misc.patch index cbe356b..7436d26 100644 --- a/coreutils-misc.patch +++ b/coreutils-misc.patch @@ -1,7 +1,7 @@ Index: gnulib-tests/test-isnanl.h =================================================================== ---- gnulib-tests/test-isnanl.h.orig 2012-01-06 08:20:50.000000000 +0100 -+++ gnulib-tests/test-isnanl.h 2012-04-16 13:22:02.969027310 +0200 +--- gnulib-tests/test-isnanl.h.orig ++++ gnulib-tests/test-isnanl.h @@ -47,7 +47,7 @@ main () /* Quiet NaN. */ ASSERT (isnanl (NaNl ())); @@ -29,8 +29,8 @@ Index: gnulib-tests/test-isnanl.h } Index: tests/misc/help-version =================================================================== ---- tests/misc/help-version.orig 2012-03-24 19:22:13.000000000 +0100 -+++ tests/misc/help-version 2012-04-16 13:22:02.970027285 +0200 +--- tests/misc/help-version.orig ++++ tests/misc/help-version @@ -251,6 +251,7 @@ parted_setup () { args="-s $tmp_in mklab for i in $built_programs; do # Skip these. @@ -41,8 +41,8 @@ Index: tests/misc/help-version echo z |gzip > $zin Index: tests/other-fs-tmpdir =================================================================== ---- tests/other-fs-tmpdir.orig 2012-03-24 19:22:13.000000000 +0100 -+++ tests/other-fs-tmpdir 2012-04-16 13:22:02.970027285 +0200 +--- tests/other-fs-tmpdir.orig ++++ tests/other-fs-tmpdir @@ -43,6 +43,9 @@ for d in $CANDIDATE_TMP_DIRS; do done diff --git a/coreutils-ptr_int_casts.patch b/coreutils-ptr_int_casts.patch index 48a356b..588a5d8 100644 --- a/coreutils-ptr_int_casts.patch +++ b/coreutils-ptr_int_casts.patch @@ -1,7 +1,7 @@ Index: src/join.c =================================================================== ---- src/join.c.orig 2012-04-16 16:54:22.032279169 +0200 -+++ src/join.c 2012-04-16 16:54:22.163275636 +0200 +--- src/join.c.orig ++++ src/join.c @@ -1320,7 +1320,7 @@ main (int argc, char **argv) case 't': diff --git a/coreutils-remove_hostname_documentation.patch b/coreutils-remove_hostname_documentation.patch index 583151d..bfc4896 100644 --- a/coreutils-remove_hostname_documentation.patch +++ b/coreutils-remove_hostname_documentation.patch @@ -1,7 +1,7 @@ Index: doc/coreutils.texi =================================================================== ---- doc/coreutils.texi.orig 2012-03-26 07:38:37.000000000 +0200 -+++ doc/coreutils.texi 2012-04-16 13:22:12.487797130 +0200 +--- doc/coreutils.texi.orig ++++ doc/coreutils.texi @@ -66,7 +66,6 @@ * groups: (coreutils)groups invocation. Print group names a user is in. * head: (coreutils)head invocation. Output the first part of files. @@ -27,7 +27,7 @@ Index: doc/coreutils.texi * hostid invocation:: Print numeric host identifier * uptime invocation:: Print system uptime and load -@@ -14135,7 +14133,6 @@ information. +@@ -14145,7 +14143,6 @@ information. * arch invocation:: Print machine hardware name. * nproc invocation:: Print the number of processors. * uname invocation:: Print system information. @@ -35,7 +35,7 @@ Index: doc/coreutils.texi * hostid invocation:: Print numeric host identifier. * uptime invocation:: Print system uptime and load. @end menu -@@ -14922,15 +14919,6 @@ easily available, as is the case with Li +@@ -14932,15 +14929,6 @@ easily available, as is the case with Li Print the machine hardware name (sometimes called the hardware class or hardware type). @@ -51,7 +51,7 @@ Index: doc/coreutils.texi @item -p @itemx --processor @opindex -p -@@ -14984,30 +14972,6 @@ Print the kernel version. +@@ -14994,30 +14982,6 @@ Print the kernel version. @exitstatus @@ -84,8 +84,8 @@ Index: doc/coreutils.texi @section @command{hostid}: Print numeric host identifier Index: man/Makefile.am =================================================================== ---- man/Makefile.am.orig 2012-03-26 11:50:41.000000000 +0200 -+++ man/Makefile.am 2012-04-16 13:22:02.980027043 +0200 +--- man/Makefile.am.orig ++++ man/Makefile.am @@ -199,7 +199,7 @@ check-x-vs-1: @PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=$@-t; \ @@ -97,9 +97,9 @@ Index: man/Makefile.am rm $$t Index: man/Makefile.in =================================================================== ---- man/Makefile.in.orig 2012-03-26 11:50:44.000000000 +0200 -+++ man/Makefile.in 2012-04-16 13:22:02.980027043 +0200 -@@ -2030,7 +2030,7 @@ check-x-vs-1: +--- man/Makefile.in.orig ++++ man/Makefile.in +@@ -2065,7 +2065,7 @@ check-x-vs-1: @PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=$@-t; \ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ diff --git a/coreutils-sysinfo.patch b/coreutils-sysinfo.patch index 2004a39..956a5b6 100644 --- a/coreutils-sysinfo.patch +++ b/coreutils-sysinfo.patch @@ -1,7 +1,7 @@ Index: src/uname.c =================================================================== ---- src/uname.c.orig 2012-03-24 21:26:51.000000000 +0100 -+++ src/uname.c 2012-04-16 13:22:02.996026656 +0200 +--- src/uname.c.orig ++++ src/uname.c @@ -337,6 +337,36 @@ main (int argc, char **argv) # endif } diff --git a/coreutils-testsuite.changes b/coreutils-testsuite.changes index b428663..67b4692 100644 --- a/coreutils-testsuite.changes +++ b/coreutils-testsuite.changes @@ -1,3 +1,47 @@ +------------------------------------------------------------------- +Wed Jan 16 18:26:15 UTC 2013 - mail@bernhard-voelker.de + +- Avoid segmentation fault in "uniq" with long line input (bnc#796243, VUL-1) + + * src/cut.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch) + +- Fix test-suite errors (bnc#798261). + + * tests/cp/fiemap-FMR: Fix path to src directory and declare + require_valgrind_ function. + (coreutils-cp-corrupt-fragmented-sparse.patch) + * tests/misc/cut: + Fix src/cut.c to properly pass output-delimiter tests. + Synchronize cut.c related part of the i18n patch with Fedora's. + Merge coreutils-i18n-infloop.patch into coreutils-i18n.patch. + Merge coreutils-i18n-uninit.patch into coreutils-i18n.patch. + In tests/misc/cut, do not replace the non-i18n error messages. + (coreutils-i18n.patch) + * tests/rm/ext3-perf: + This test failed due to heavy parallel CPU and/or disk load because it + is based on timeouts. Do not run the test-suite with 'make -jN. + (coreutils.spec, coreutils-testsuite.spec) + * Further spec changes: + Run more tests: also run "very expensive" tests; add acl, python-pyinotify, + strace and valgrind to the build requirements. + Remove patch5 and patch6 as they are now merged into coreutils-i18n.patch + (see above). + (coreutils.spec, coreutils-testsuite.spec) + +- Maintenance changes: + (coreutils.spec, coreutils-testsuite.spec) + + * Add perl and texinfo to the build requirements as they are needed to + re-generate the man pages and the texinfo documentation. + * Remove already-active "-Wall" compiler option from CFLAGS variable. + * Install the compressed test-suite.log into the documentation directory + of the coreutils-testsuite package (section %check and %files). + * Properly guard the spec sections for the coreutils and the + coreutils-testsuite package. + * Update patches to reflect new line numbers. + ------------------------------------------------------------------- Thu Jan 10 21:18:52 CET 2013 - phisama@suse.de diff --git a/coreutils-testsuite.spec b/coreutils-testsuite.spec index 2f5861d..6193f5d 100644 --- a/coreutils-testsuite.spec +++ b/coreutils-testsuite.spec @@ -27,9 +27,15 @@ BuildRequires: libacl-devel BuildRequires: libcap-devel BuildRequires: libselinux-devel BuildRequires: pam-devel +BuildRequires: perl +BuildRequires: texinfo %if "%{name}" == "coreutils-testsuite" +BuildRequires: acl BuildRequires: gdb BuildRequires: perl-Expect +BuildRequires: python-pyinotify +BuildRequires: strace +BuildRequires: valgrind %endif BuildRequires: xz Url: http://www.gnu.org/software/coreutils/ @@ -62,8 +68,6 @@ Patch1: coreutils-remove_hostname_documentation.patch Patch2: coreutils-gl_printf_safe.patch #Remove the bogus coreutils version from the i18n patch name Patch4: coreutils-i18n.patch -Patch5: coreutils-i18n-uninit.patch -Patch6: coreutils-i18n-infloop.patch Patch8: coreutils-sysinfo.patch Patch16: coreutils-invalid-ids.patch Patch20: coreutils-8.6-pam-support-for-su.diff @@ -88,6 +92,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # prerequires #PreReq: permissions +# ================================================ %description Basic file, shell, and text manipulation utilities. The package contains the following programs: @@ -101,12 +106,11 @@ sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split stat stty su sum sync tac tail tee test timeout touch tr true tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes +# ================================================ %lang_package %prep %setup -q -n coreutils-%{version} %patch4 -%patch5 -%patch6 %patch0 %patch1 %patch2 @@ -118,7 +122,6 @@ uname unexpand uniq unlink uptime users vdir wc who whoami yes %patch23 -p1 %patch24 %patch25 -# %patch30 %patch31 %patch32 @@ -137,11 +140,12 @@ xz -dc %{S:4} >po/de.po # We need to statically link to gmp, otherwise we have a build loop sed -i s,'$(LIB_GMP)',%{_libdir}/libgmp.a,g src/Makefile.am +# ================================================ %build %if 0%{suse_version} >= 1200 AUTOPOINT=true autoreconf -fi %endif -export CFLAGS="%optflags -Wall" +export CFLAGS="%optflags" %configure --libexecdir=%{_libdir} --without-included-regex \ --enable-install-program=arch,su \ gl_cv_func_printf_directive_n=yes \ @@ -151,12 +155,19 @@ export CFLAGS="%optflags -Wall" make -C po update-po make %{?_smp_mflags} V=1 -%if "%{name}" == "coreutils-testsuite" +# ================================================ %check -make %{?_smp_mflags} check-very-expensive +%if "%{name}" == "coreutils-testsuite" + # Avoid parallel make, because otherwise some timeout based tests like + # rm/ext3-perf may fail due to high CPU or IO load. + make check-very-expensive + install -d -m 755 %{buildroot}%{_docdir}/%{name} + xz -c tests/test-suite.log > %{buildroot}%{_docdir}/%{name}/test-suite.log.xz %endif +# ================================================ %install +%if "%{name}" == "coreutils" %makeinstall pkglibexecdir=%{_libdir}/%{name} test -f %{buildroot}%{_bindir}/su || \ install src/su %{buildroot}%{_bindir}/su @@ -164,7 +175,7 @@ test -f %{buildroot}%{_bindir}/su || \ install -d %{buildroot}/bin for i in arch basename cat chgrp chmod chown cp date dd df echo false kill ln ls mkdir mknod mktemp mv pwd rm rmdir sleep sort stat stty su sync touch true uname readlink md5sum do - ln -sf %{_bindir}/$i %{buildroot}/bin/$i + ln -sf %{_bindir}/$i %{buildroot}/bin/$i done #EndUsrMerge install -d -m 755 %{buildroot}/etc/pam.d @@ -174,19 +185,26 @@ install -d -m 755 %{buildroot}/etc/default install -m 644 %{S:2} %{buildroot}/etc/default/su echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %find_lang coreutils +%endif +# ================================================ %post %install_info --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz # may fail if permissions is not there, but there is no way around that %set_permissions %{_bindir}/su +# ================================================ %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz +# ================================================ %verifyscript %verify_permissions -e %{_bindir}/su +# ================================================ %files +%if "%{name}" == "coreutils" + %defattr(-,root,root) %doc README NEWS %config %{_sysconfdir}/pam.d/su @@ -205,4 +223,14 @@ echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %files lang -f coreutils.lang %defattr(-,root,root) +%else + +# test-suite +%dir %{_docdir}/%{name} +%doc %{_docdir}/%{name}/test-suite.log.xz + +%endif + +# ================================================ + %changelog diff --git a/coreutils.changes b/coreutils.changes index b428663..67b4692 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,3 +1,47 @@ +------------------------------------------------------------------- +Wed Jan 16 18:26:15 UTC 2013 - mail@bernhard-voelker.de + +- Avoid segmentation fault in "uniq" with long line input (bnc#796243, VUL-1) + + * src/cut.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch) + +- Fix test-suite errors (bnc#798261). + + * tests/cp/fiemap-FMR: Fix path to src directory and declare + require_valgrind_ function. + (coreutils-cp-corrupt-fragmented-sparse.patch) + * tests/misc/cut: + Fix src/cut.c to properly pass output-delimiter tests. + Synchronize cut.c related part of the i18n patch with Fedora's. + Merge coreutils-i18n-infloop.patch into coreutils-i18n.patch. + Merge coreutils-i18n-uninit.patch into coreutils-i18n.patch. + In tests/misc/cut, do not replace the non-i18n error messages. + (coreutils-i18n.patch) + * tests/rm/ext3-perf: + This test failed due to heavy parallel CPU and/or disk load because it + is based on timeouts. Do not run the test-suite with 'make -jN. + (coreutils.spec, coreutils-testsuite.spec) + * Further spec changes: + Run more tests: also run "very expensive" tests; add acl, python-pyinotify, + strace and valgrind to the build requirements. + Remove patch5 and patch6 as they are now merged into coreutils-i18n.patch + (see above). + (coreutils.spec, coreutils-testsuite.spec) + +- Maintenance changes: + (coreutils.spec, coreutils-testsuite.spec) + + * Add perl and texinfo to the build requirements as they are needed to + re-generate the man pages and the texinfo documentation. + * Remove already-active "-Wall" compiler option from CFLAGS variable. + * Install the compressed test-suite.log into the documentation directory + of the coreutils-testsuite package (section %check and %files). + * Properly guard the spec sections for the coreutils and the + coreutils-testsuite package. + * Update patches to reflect new line numbers. + ------------------------------------------------------------------- Thu Jan 10 21:18:52 CET 2013 - phisama@suse.de diff --git a/coreutils.spec b/coreutils.spec index b7a57ec..3de8066 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -27,9 +27,15 @@ BuildRequires: libacl-devel BuildRequires: libcap-devel BuildRequires: libselinux-devel BuildRequires: pam-devel +BuildRequires: perl +BuildRequires: texinfo %if "%{name}" == "coreutils-testsuite" +BuildRequires: acl BuildRequires: gdb BuildRequires: perl-Expect +BuildRequires: python-pyinotify +BuildRequires: strace +BuildRequires: valgrind %endif BuildRequires: xz Url: http://www.gnu.org/software/coreutils/ @@ -62,8 +68,6 @@ Patch1: coreutils-remove_hostname_documentation.patch Patch2: coreutils-gl_printf_safe.patch #Remove the bogus coreutils version from the i18n patch name Patch4: coreutils-i18n.patch -Patch5: coreutils-i18n-uninit.patch -Patch6: coreutils-i18n-infloop.patch Patch8: coreutils-sysinfo.patch Patch16: coreutils-invalid-ids.patch Patch20: coreutils-8.6-pam-support-for-su.diff @@ -88,6 +92,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # prerequires #PreReq: permissions +# ================================================ %description Basic file, shell, and text manipulation utilities. The package contains the following programs: @@ -101,12 +106,11 @@ sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split stat stty su sum sync tac tail tee test timeout touch tr true tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes +# ================================================ %lang_package %prep %setup -q -n coreutils-%{version} %patch4 -%patch5 -%patch6 %patch0 %patch1 %patch2 @@ -118,7 +122,6 @@ uname unexpand uniq unlink uptime users vdir wc who whoami yes %patch23 -p1 %patch24 %patch25 -# %patch30 %patch31 %patch32 @@ -137,11 +140,12 @@ xz -dc %{S:4} >po/de.po # We need to statically link to gmp, otherwise we have a build loop sed -i s,'$(LIB_GMP)',%{_libdir}/libgmp.a,g src/Makefile.am +# ================================================ %build %if 0%{suse_version} >= 1200 AUTOPOINT=true autoreconf -fi %endif -export CFLAGS="%optflags -Wall" +export CFLAGS="%optflags" %configure --libexecdir=%{_libdir} --without-included-regex \ --enable-install-program=arch,su \ gl_cv_func_printf_directive_n=yes \ @@ -151,12 +155,19 @@ export CFLAGS="%optflags -Wall" make -C po update-po make %{?_smp_mflags} V=1 -%if "%{name}" == "coreutils-testsuite" +# ================================================ %check -make %{?_smp_mflags} check-very-expensive +%if "%{name}" == "coreutils-testsuite" + # Avoid parallel make, because otherwise some timeout based tests like + # rm/ext3-perf may fail due to high CPU or IO load. + make check-very-expensive + install -d -m 755 %{buildroot}%{_docdir}/%{name} + xz -c tests/test-suite.log > %{buildroot}%{_docdir}/%{name}/test-suite.log.xz %endif +# ================================================ %install +%if "%{name}" == "coreutils" %makeinstall pkglibexecdir=%{_libdir}/%{name} test -f %{buildroot}%{_bindir}/su || \ install src/su %{buildroot}%{_bindir}/su @@ -164,7 +175,7 @@ test -f %{buildroot}%{_bindir}/su || \ install -d %{buildroot}/bin for i in arch basename cat chgrp chmod chown cp date dd df echo false kill ln ls mkdir mknod mktemp mv pwd rm rmdir sleep sort stat stty su sync touch true uname readlink md5sum do - ln -sf %{_bindir}/$i %{buildroot}/bin/$i + ln -sf %{_bindir}/$i %{buildroot}/bin/$i done #EndUsrMerge install -d -m 755 %{buildroot}/etc/pam.d @@ -174,19 +185,26 @@ install -d -m 755 %{buildroot}/etc/default install -m 644 %{S:2} %{buildroot}/etc/default/su echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %find_lang coreutils +%endif +# ================================================ %post %install_info --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz # may fail if permissions is not there, but there is no way around that %set_permissions %{_bindir}/su +# ================================================ %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz +# ================================================ %verifyscript %verify_permissions -e %{_bindir}/su +# ================================================ %files +%if "%{name}" == "coreutils" + %defattr(-,root,root) %doc README NEWS %config %{_sysconfdir}/pam.d/su @@ -205,4 +223,14 @@ echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %files lang -f coreutils.lang %defattr(-,root,root) +%else + +# test-suite +%dir %{_docdir}/%{name} +%doc %{_docdir}/%{name}/test-suite.log.xz + +%endif + +# ================================================ + %changelog From 94e801cf55202c3de7e0bc7d15b5c64608ca16e56d65979dd20c550960c2262d Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Thu, 17 Jan 2013 16:45:17 +0000 Subject: [PATCH 3/4] - Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1) * src/join.c: Instead of usig unreliable alloca() stack allocation, use heap allocation via xmalloc()+free(). (coreutils-i18n.patch, from Philipp Thomas ) - Avoid segmentation fault in "sort -d" and "sort -M" with long line input (bnc#798538, VUL-1) * src/sort.c: Instead of usig unreliable alloca() stack allocation, use heap allocation via xmalloc()+free(). (coreutils-i18n.patch, from Philipp Thomas ) OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=173 --- coreutils-8.9-singlethreaded-sort.patch | 2 +- coreutils-i18n.patch | 64 ++++++++++++++++--------- coreutils-ptr_int_casts.patch | 4 +- coreutils-testsuite.changes | 15 +++++- coreutils.changes | 15 +++++- 5 files changed, 73 insertions(+), 27 deletions(-) diff --git a/coreutils-8.9-singlethreaded-sort.patch b/coreutils-8.9-singlethreaded-sort.patch index e443c30..376457b 100644 --- a/coreutils-8.9-singlethreaded-sort.patch +++ b/coreutils-8.9-singlethreaded-sort.patch @@ -2,7 +2,7 @@ Index: src/sort.c =================================================================== --- src/sort.c.orig +++ src/sort.c -@@ -5286,7 +5286,11 @@ main (int argc, char **argv) +@@ -5291,7 +5291,11 @@ main (int argc, char **argv) { if (!nthreads) { diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index 64e92dd..e3c66a4 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -1469,7 +1469,7 @@ Index: src/join.c static void freeline (struct line *line) { -@@ -313,56 +472,115 @@ keycmp (struct line const *line1, struct +@@ -313,56 +472,130 @@ keycmp (struct line const *line1, struct size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1483,6 +1483,7 @@ Index: src/join.c + size_t len[2]; /* Length of fields to compare. */ int diff; + int i, j; ++ int mallocd = 0; if (jf_1 < line1->nfields) { @@ -1538,7 +1539,8 @@ Index: src/join.c + + for (i = 0; i < 2; i++) + { -+ copy[i] = alloca (len[i] + 1); ++ mallocd = 1; ++ copy[i] = xmalloc (len[i] + 1); + + for (j = 0; j < MIN (len[0], len[1]);) + { @@ -1578,7 +1580,8 @@ Index: src/join.c + { + for (i = 0; i < 2; i++) + { -+ copy[i] = alloca (len[i] + 1); ++ mallocd = 1; ++ copy[i] = xmalloc (len[i] + 1); + + for (j = 0; j < MIN (len[0], len[1]); j++) + copy[i][j] = toupper (beg[i][j]); @@ -1594,12 +1597,24 @@ Index: src/join.c - diff = memcmp (beg1, beg2, MIN (len1, len2)); + copy[0] = (unsigned char *) beg[0]; + copy[1] = (unsigned char *) beg[1]; ++ } ++ ++ if (hard_LC_COLLATE) ++ { ++ diff = xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); ++ ++ if (mallocd) ++ for (i = 0; i < 2; i++) ++ free (copy[i]); ++ ++ return diff; } -+ if (hard_LC_COLLATE) -+ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); + diff = memcmp (copy[0], copy[1], MIN (len[0], len[1])); + ++ if (mallocd) ++ for (i = 0; i < 2; i++) ++ free (copy[i]); + if (diff) return diff; @@ -1608,7 +1623,7 @@ Index: src/join.c } /* Check that successive input lines PREV and CURRENT from input file -@@ -454,6 +672,12 @@ get_line (FILE *fp, struct line **linep, +@@ -454,6 +687,12 @@ get_line (FILE *fp, struct line **linep, } ++line_no[which - 1]; @@ -1621,7 +1636,7 @@ Index: src/join.c xfields (line); if (prevline[which - 1]) -@@ -552,22 +776,29 @@ prfield (size_t n, struct line const *li +@@ -552,22 +791,29 @@ prfield (size_t n, struct line const *li } /* Output all the fields in line, other than the join field. */ @@ -1654,7 +1669,7 @@ Index: src/join.c prfield (i, line); } } -@@ -578,7 +809,6 @@ static void +@@ -578,7 +824,6 @@ static void prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -1662,7 +1677,7 @@ Index: src/join.c size_t field; struct line const *line; -@@ -612,7 +842,7 @@ prjoin (struct line const *line1, struct +@@ -612,7 +857,7 @@ prjoin (struct line const *line1, struct o = o->next; if (o == NULL) break; @@ -1671,7 +1686,7 @@ Index: src/join.c } putchar ('\n'); } -@@ -1090,21 +1320,46 @@ main (int argc, char **argv) +@@ -1090,21 +1335,46 @@ main (int argc, char **argv) case 't': { @@ -3038,7 +3053,7 @@ Index: src/sort.c && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned)) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2442,11 +2804,83 @@ key_warnings (struct keyfield const *gke +@@ -2442,11 +2804,87 @@ key_warnings (struct keyfield const *gke error (0, 0, _("option '-r' only applies to last-resort comparison")); } @@ -3065,13 +3080,13 @@ Index: src/sort.c + if (len == 0) + return 0; + -+ month = (char *) alloca (len + 1); ++ month = (char *) xmalloc (len + 1); + -+ tmp = (char *) alloca (len + 1); ++ tmp = (char *) xmalloc (len + 1); + memcpy (tmp, s, len); + tmp[len] = '\0'; + pp = (const char **)&tmp; -+ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t)); ++ month_wcs = (wchar_t *) xmalloc ((len + 1) * sizeof (wchar_t)); + memset (&state, '\0', sizeof(mbstate_t)); + + wclength = mbsrtowcs (month_wcs, pp, len + 1, &state); @@ -3110,6 +3125,10 @@ Index: src/sort.c + result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name)) + ? monthtab[lo].val : 0); + ++ free (month); ++ free (tmp); ++ free (month_wcs); ++ + return result; +} +#endif @@ -3123,7 +3142,7 @@ Index: src/sort.c { struct keyfield *key = keylist; -@@ -2531,7 +2965,7 @@ keycompare (struct line const *a, struct +@@ -2531,7 +2969,7 @@ keycompare (struct line const *a, struct else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -3132,7 +3151,7 @@ Index: src/sort.c else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2647,6 +3081,180 @@ keycompare (struct line const *a, struct +@@ -2647,6 +3085,181 @@ keycompare (struct line const *a, struct return key->reverse ? -diff : diff; } @@ -3188,7 +3207,7 @@ Index: src/sort.c + { + if (ignore || translate) + { -+ char *copy_a = (char *) alloca (lena + 1 + lenb + 1); ++ char *copy_a = xmalloc (lena + 1 + lenb + 1); + char *copy_b = copy_a + lena + 1; + size_t new_len_a, new_len_b; + size_t i, j; @@ -3264,6 +3283,7 @@ Index: src/sort.c + IGNORE_CHARS (new_len_b, lenb, textb, copy_b, + wc_b, mblength_b, state_b); + diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b); ++ free(copy_a); + } + else if (lena == 0) + diff = - NONZERO (lenb); @@ -3313,7 +3333,7 @@ Index: src/sort.c /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -4107,7 +4715,7 @@ main (int argc, char **argv) +@@ -4107,7 +4720,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3322,7 +3342,7 @@ Index: src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4128,6 +4736,29 @@ main (int argc, char **argv) +@@ -4128,6 +4741,29 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -3352,7 +3372,7 @@ Index: src/sort.c have_read_stdin = false; inittables (); -@@ -4398,13 +5029,34 @@ main (int argc, char **argv) +@@ -4398,13 +5034,34 @@ main (int argc, char **argv) case 't': { @@ -3391,7 +3411,7 @@ Index: src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4415,9 +5067,12 @@ main (int argc, char **argv) +@@ -4415,9 +5072,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3874,7 +3894,7 @@ Index: src/uniq.c + + for (i = 0; i < 2; i++) + { -+ copy[i] = xmalloc (sizeof(char) * (len[i] + 1)); ++ copy[i] = xmalloc (len[i] + 1); + + for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) + { diff --git a/coreutils-ptr_int_casts.patch b/coreutils-ptr_int_casts.patch index 588a5d8..96a8ebc 100644 --- a/coreutils-ptr_int_casts.patch +++ b/coreutils-ptr_int_casts.patch @@ -2,7 +2,7 @@ Index: src/join.c =================================================================== --- src/join.c.orig +++ src/join.c -@@ -1320,7 +1320,7 @@ main (int argc, char **argv) +@@ -1335,7 +1335,7 @@ main (int argc, char **argv) case 't': { @@ -11,7 +11,7 @@ Index: src/join.c size_t newtablen; newtab = xstrdup (optarg); #if HAVE_MBRTOWC -@@ -1342,7 +1342,7 @@ main (int argc, char **argv) +@@ -1357,7 +1357,7 @@ main (int argc, char **argv) newtablen = 1; if (! newtab) { diff --git a/coreutils-testsuite.changes b/coreutils-testsuite.changes index 67b4692..1d0bb0b 100644 --- a/coreutils-testsuite.changes +++ b/coreutils-testsuite.changes @@ -1,5 +1,18 @@ ------------------------------------------------------------------- -Wed Jan 16 18:26:15 UTC 2013 - mail@bernhard-voelker.de +Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de + +- Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1) + + * src/join.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch, from Philipp Thomas ) + +- Avoid segmentation fault in "sort -d" and "sort -M" with long line input + (bnc#798538, VUL-1) + + * src/sort.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch, from Philipp Thomas ) - Avoid segmentation fault in "uniq" with long line input (bnc#796243, VUL-1) diff --git a/coreutils.changes b/coreutils.changes index 67b4692..1d0bb0b 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,5 +1,18 @@ ------------------------------------------------------------------- -Wed Jan 16 18:26:15 UTC 2013 - mail@bernhard-voelker.de +Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de + +- Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1) + + * src/join.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch, from Philipp Thomas ) + +- Avoid segmentation fault in "sort -d" and "sort -M" with long line input + (bnc#798538, VUL-1) + + * src/sort.c: Instead of usig unreliable alloca() stack allocation, + use heap allocation via xmalloc()+free(). + (coreutils-i18n.patch, from Philipp Thomas ) - Avoid segmentation fault in "uniq" with long line input (bnc#796243, VUL-1) From f6d4b45a7b7f4ac10f0b40b25ad7e160e479b72881c4f3a75c67f1ed945095d7 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sun, 20 Jan 2013 13:51:29 +0000 Subject: [PATCH 4/4] Accepting request 149313 from home:bernhard-voelker:branches:Base:System skip tests/du/slink to make the testsuite succeed again OBS-URL: https://build.opensuse.org/request/show/149313 OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=174 --- coreutils-skip-du-slink-test.patch | 29 +++++++++++++++++++++++++++++ coreutils-testsuite.changes | 8 +++++++- coreutils-testsuite.spec | 2 ++ coreutils.changes | 8 +++++++- coreutils.spec | 2 ++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 coreutils-skip-du-slink-test.patch diff --git a/coreutils-skip-du-slink-test.patch b/coreutils-skip-du-slink-test.patch new file mode 100644 index 0000000..e17e128 --- /dev/null +++ b/coreutils-skip-du-slink-test.patch @@ -0,0 +1,29 @@ +From: Bernhard Voelker +Date: Sun, 20 Jan 2013 14:12:00 +0200 +Subject: [PATCH] Skip tests/du/slink on OBS + +This test does not work on OBS infrastructure. +Discussed at: +http://lists.gnu.org/archive/html/coreutils/2013-01/msg00053.html + +The test will be removed upstreams with coreutils-8.21. +Until then, skip this test. + + +--- + tests/du/slink | 2 ++ + 1 file changed, 2 insertions(+) + +Index: coreutils-8.17/tests/du/slink +=================================================================== +--- coreutils-8.17.orig/tests/du/slink ++++ coreutils-8.17/tests/du/slink +@@ -19,6 +19,8 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../src + print_ver_ du + ++skip_ "test does not work on OpenSUSE Build Service infrastructure" ++ + # Determine if '.' is on a local (would non-NFS be sufficient?) file system. + # At least on OSF/1 4.0d, when using an nfsv3 file system, + # each created symlink can end up having a size of 0. diff --git a/coreutils-testsuite.changes b/coreutils-testsuite.changes index 1d0bb0b..189eb4c 100644 --- a/coreutils-testsuite.changes +++ b/coreutils-testsuite.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de +Sun Jan 20 13:18:28 UTC 2013 - mail@bernhard-voelker.de - Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1) @@ -36,6 +36,12 @@ Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de This test failed due to heavy parallel CPU and/or disk load because it is based on timeouts. Do not run the test-suite with 'make -jN. (coreutils.spec, coreutils-testsuite.spec) + * tests/du/slink: + This test fails on OBS infrastructure and will be removed upstreams + in coreutils-8.21 anyway. Skip the test until we upgrade. + Upstream discussion: + http://lists.gnu.org/archive/html/coreutils/2013-01/msg00053.html + (coreutils-skip-du-slink-test.patch) * Further spec changes: Run more tests: also run "very expensive" tests; add acl, python-pyinotify, strace and valgrind to the build requirements. diff --git a/coreutils-testsuite.spec b/coreutils-testsuite.spec index 6193f5d..22558ed 100644 --- a/coreutils-testsuite.spec +++ b/coreutils-testsuite.spec @@ -87,6 +87,7 @@ Patch37: coreutils-bnc#697897-setsid.patch Patch38: coreutils-cp-corrupt-fragmented-sparse.patch Patch39: coreutils-no_silent-rule.patch Patch40: coreutils-df-always-hide-rootfs.patch +Patch41: coreutils-skip-du-slink-test.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # this will create a cycle, broken up randomly - coreutils is just too core to have other # prerequires @@ -134,6 +135,7 @@ uname unexpand uniq unlink uptime users vdir wc who whoami yes %patch39 %endif %patch40 -p1 +%patch41 -p1 xz -dc %{S:4} >po/de.po diff --git a/coreutils.changes b/coreutils.changes index 1d0bb0b..189eb4c 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de +Sun Jan 20 13:18:28 UTC 2013 - mail@bernhard-voelker.de - Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1) @@ -36,6 +36,12 @@ Thu Jan 17 16:41:34 UTC 2013 - mail@bernhard-voelker.de This test failed due to heavy parallel CPU and/or disk load because it is based on timeouts. Do not run the test-suite with 'make -jN. (coreutils.spec, coreutils-testsuite.spec) + * tests/du/slink: + This test fails on OBS infrastructure and will be removed upstreams + in coreutils-8.21 anyway. Skip the test until we upgrade. + Upstream discussion: + http://lists.gnu.org/archive/html/coreutils/2013-01/msg00053.html + (coreutils-skip-du-slink-test.patch) * Further spec changes: Run more tests: also run "very expensive" tests; add acl, python-pyinotify, strace and valgrind to the build requirements. diff --git a/coreutils.spec b/coreutils.spec index 3de8066..43b755f 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -87,6 +87,7 @@ Patch37: coreutils-bnc#697897-setsid.patch Patch38: coreutils-cp-corrupt-fragmented-sparse.patch Patch39: coreutils-no_silent-rule.patch Patch40: coreutils-df-always-hide-rootfs.patch +Patch41: coreutils-skip-du-slink-test.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # this will create a cycle, broken up randomly - coreutils is just too core to have other # prerequires @@ -134,6 +135,7 @@ uname unexpand uniq unlink uptime users vdir wc who whoami yes %patch39 %endif %patch40 -p1 +%patch41 -p1 xz -dc %{S:4} >po/de.po