summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-arch/tar/ChangeLog9
-rw-r--r--app-arch/tar/files/tar-1.24-mkdirat.patch31
-rw-r--r--app-arch/tar/files/tar-1.24-transform-2.patch53
-rw-r--r--app-arch/tar/files/tar-1.24-transform.patch173
-rw-r--r--app-arch/tar/tar-1.24-r1.ebuild72
5 files changed, 337 insertions, 1 deletions
diff --git a/app-arch/tar/ChangeLog b/app-arch/tar/ChangeLog
index 86215518c60f..79f1874285ec 100644
--- a/app-arch/tar/ChangeLog
+++ b/app-arch/tar/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-arch/tar
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.156 2010/10/26 06:31:44 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.157 2010/10/27 18:19:39 ssuominen Exp $
+
+*tar-1.24-r1 (27 Oct 2010)
+
+ 27 Oct 2010; Samuli Suominen <ssuominen@gentoo.org> +tar-1.24-r1.ebuild,
+ +files/tar-1.24-mkdirat.patch, +files/tar-1.24-transform.patch,
+ +files/tar-1.24-transform-2.patch:
+ Fix -C switch wrt #342735 by "ferret". Fix --transform switch wrt #342785.
26 Oct 2010; Samuli Suominen <ssuominen@gentoo.org> tar-1.24.ebuild:
Fix ./configure with FEATURES="-userpriv" wrt #342593.
diff --git a/app-arch/tar/files/tar-1.24-mkdirat.patch b/app-arch/tar/files/tar-1.24-mkdirat.patch
new file mode 100644
index 000000000000..51d2f2a8255b
--- /dev/null
+++ b/app-arch/tar/files/tar-1.24-mkdirat.patch
@@ -0,0 +1,31 @@
+From acb77ac5bd4bf9248070c9c512525eee8258aebd Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue, 26 Oct 2010 03:20:19 +0000
+Subject: tar: fix bug with -C and extracting directories
+
+Problem reported by Denis Excoffier in
+<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
+
+* src/extract.c (extract_dir): Use mkdirat, not mkdir.
+* tests/extrac16.at: New file, to test for this bug.
+* tests/Makefile.am (TESTSUITE_AT): Add it.
+* tests/testsuite.at: Include it.
+
+This file is a placeholder. It will be replaced with the actual ChangeLog
+by make dist. Run make ChangeLog if you wish to create it earlier.
+---
+diff --git a/src/extract.c b/src/extract.c
+index 0d23d4a..98236ac 100644
+--- a/src/extract.c
++++ b/src/extract.c
+@@ -777,7 +777,7 @@ extract_dir (char *file_name, int typeflag)
+
+ for (;;)
+ {
+- status = mkdir (file_name, mode);
++ status = mkdirat (chdir_fd, file_name, mode);
+ if (status == 0)
+ {
+ current_mode = mode & ~ current_umask;
+--
+cgit v0.8.3.2
diff --git a/app-arch/tar/files/tar-1.24-transform-2.patch b/app-arch/tar/files/tar-1.24-transform-2.patch
new file mode 100644
index 000000000000..1366c471da69
--- /dev/null
+++ b/app-arch/tar/files/tar-1.24-transform-2.patch
@@ -0,0 +1,53 @@
+From 5af29cb944c84e2d539ce9df527d63c29f6012b9 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org.ua>
+Date: Wed, 27 Oct 2010 11:07:46 +0000
+Subject: Transform file names when updating and appendig to archives.
+
+This complements 28e91b48.
+
+* src/common.h (transform_stat_info): New prototype.
+* src/list.c (transform_stat_info): Remove static qualifier.
+* src/update.c (update_archive): Call transform_stat_info.
+* tests/Makefile.am (TESTSUITE_AT): Add append03.at
+* tests/testsuite.at: Include append03.at
+---
+diff --git a/src/common.h b/src/common.h
+index 192cf9e..4a63824 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -550,6 +550,7 @@ extern size_t recent_long_link_blocks;
+
+ void decode_header (union block *header, struct tar_stat_info *stat_info,
+ enum archive_format *format_pointer, int do_user_group);
++void transform_stat_info (int typeflag, struct tar_stat_info *stat_info);
+ char const *tartime (struct timespec t, bool full_time);
+
+ #define OFF_FROM_HEADER(where) off_from_header (where, sizeof (where))
+diff --git a/src/list.c b/src/list.c
+index e1e06ca..c65e171 100644
+--- a/src/list.c
++++ b/src/list.c
+@@ -116,7 +116,7 @@ transform_member_name (char **pinput, int type)
+ return transform_name_fp (pinput, type, decode_xform, &type);
+ }
+
+-static void
++void
+ transform_stat_info (int typeflag, struct tar_stat_info *stat_info)
+ {
+ if (typeflag == GNUTYPE_VOLHDR)
+diff --git a/src/update.c b/src/update.c
+index 69fa592..e3228d4 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -130,6 +130,8 @@ update_archive (void)
+
+ decode_header (current_header, &current_stat_info,
+ &current_format, 0);
++ transform_stat_info (current_header->header.typeflag,
++ &current_stat_info);
+ archive_format = current_format;
+
+ if (subcommand_option == UPDATE_SUBCOMMAND
+--
+cgit v0.8.3.2
diff --git a/app-arch/tar/files/tar-1.24-transform.patch b/app-arch/tar/files/tar-1.24-transform.patch
new file mode 100644
index 000000000000..b6638adc9b2b
--- /dev/null
+++ b/app-arch/tar/files/tar-1.24-transform.patch
@@ -0,0 +1,173 @@
+From 28e91b48f680a6fab90ee39145123647345f385f Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org.ua>
+Date: Tue, 26 Oct 2010 14:47:16 +0000
+Subject: Make sure name matching occurs before name transformation.
+
+The commit 9c194c99 altered that order.
+
+* src/list.c (transform_stat_info): New function. Split off from
+decode_header.
+(read_and): Call transform_stat_info right before do_something,
+and after deciding if we should proceed with this member name,
+so that name matching occurs before name transformation.
+
+* tests/extrac17.at: New file.
+* tests/Makefile.am (TESTSUITE_AT): Add extrac17.at
+* tests/testsuite.at: Include extrac17.at.
+---
+diff --git a/src/list.c b/src/list.c
+index d15653d..e1e06ca 100644
+--- a/src/list.c
++++ b/src/list.c
+@@ -75,6 +75,66 @@ base64_init (void)
+ base64_map[(int) base_64_digits[i]] = i;
+ }
+
++static char *
++decode_xform (char *file_name, void *data)
++{
++ int type = *(int*)data;
++
++ switch (type)
++ {
++ case XFORM_SYMLINK:
++ /* FIXME: It is not quite clear how and to which extent are the symbolic
++ links subject to filename transformation. In the absence of another
++ solution, symbolic links are exempt from component stripping and
++ name suffix normalization, but subject to filename transformation
++ proper. */
++ return file_name;
++
++ case XFORM_LINK:
++ file_name = safer_name_suffix (file_name, true, absolute_names_option);
++ break;
++
++ case XFORM_REGFILE:
++ file_name = safer_name_suffix (file_name, false, absolute_names_option);
++ break;
++ }
++
++ if (strip_name_components)
++ {
++ size_t prefix_len = stripped_prefix_len (file_name,
++ strip_name_components);
++ if (prefix_len == (size_t) -1)
++ prefix_len = strlen (file_name);
++ file_name += prefix_len;
++ }
++ return file_name;
++}
++
++static bool
++transform_member_name (char **pinput, int type)
++{
++ return transform_name_fp (pinput, type, decode_xform, &type);
++}
++
++static void
++transform_stat_info (int typeflag, struct tar_stat_info *stat_info)
++{
++ if (typeflag == GNUTYPE_VOLHDR)
++ /* Name transformations don't apply to volume headers. */
++ return;
++
++ transform_member_name (&stat_info->file_name, XFORM_REGFILE);
++ switch (typeflag)
++ {
++ case SYMTYPE:
++ transform_member_name (&stat_info->link_name, XFORM_SYMLINK);
++ break;
++
++ case LNKTYPE:
++ transform_member_name (&stat_info->link_name, XFORM_LINK);
++ }
++}
++
+ /* Main loop for reading an archive. */
+ void
+ read_and (void (*do_something) (void))
+@@ -135,7 +195,8 @@ read_and (void (*do_something) (void))
+ continue;
+ }
+ }
+-
++ transform_stat_info (current_header->header.typeflag,
++ &current_stat_info);
+ (*do_something) ();
+ continue;
+
+@@ -495,47 +556,6 @@ read_header (union block **return_block, struct tar_stat_info *info,
+ }
+ }
+
+-static char *
+-decode_xform (char *file_name, void *data)
+-{
+- int type = *(int*)data;
+-
+- switch (type)
+- {
+- case XFORM_SYMLINK:
+- /* FIXME: It is not quite clear how and to which extent are the symbolic
+- links subject to filename transformation. In the absence of another
+- solution, symbolic links are exempt from component stripping and
+- name suffix normalization, but subject to filename transformation
+- proper. */
+- return file_name;
+-
+- case XFORM_LINK:
+- file_name = safer_name_suffix (file_name, true, absolute_names_option);
+- break;
+-
+- case XFORM_REGFILE:
+- file_name = safer_name_suffix (file_name, false, absolute_names_option);
+- break;
+- }
+-
+- if (strip_name_components)
+- {
+- size_t prefix_len = stripped_prefix_len (file_name,
+- strip_name_components);
+- if (prefix_len == (size_t) -1)
+- prefix_len = strlen (file_name);
+- file_name += prefix_len;
+- }
+- return file_name;
+-}
+-
+-static bool
+-transform_member_name (char **pinput, int type)
+-{
+- return transform_name_fp (pinput, type, decode_xform, &type);
+-}
+-
+ #define ISOCTAL(c) ((c)>='0'&&(c)<='7')
+
+ /* Decode things from a file HEADER block into STAT_INFO, also setting
+@@ -655,23 +675,9 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
+ || stat_info->dumpdir)
+ stat_info->is_dumpdir = true;
+ }
+-
+- if (header->header.typeflag == GNUTYPE_VOLHDR)
+- /* Name transformations don't apply to volume headers. */
+- return;
+-
+- transform_member_name (&stat_info->file_name, XFORM_REGFILE);
+- switch (header->header.typeflag)
+- {
+- case SYMTYPE:
+- transform_member_name (&stat_info->link_name, XFORM_SYMLINK);
+- break;
+-
+- case LNKTYPE:
+- transform_member_name (&stat_info->link_name, XFORM_LINK);
+- }
+ }
+
++
+ /* Convert buffer at WHERE0 of size DIGS from external format to
+ uintmax_t. DIGS must be positive. If TYPE is nonnull, the data
+ are of type TYPE. The buffer must represent a value in the range
+--
+cgit v0.8.3.2
diff --git a/app-arch/tar/tar-1.24-r1.ebuild b/app-arch/tar/tar-1.24-r1.ebuild
new file mode 100644
index 000000000000..9c08d7905e9d
--- /dev/null
+++ b/app-arch/tar/tar-1.24-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/tar-1.24-r1.ebuild,v 1.1 2010/10/27 18:19:39 ssuominen Exp $
+
+EAPI="2"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Use this to make tarballs :)"
+HOMEPAGE="http://www.gnu.org/software/tar/"
+SRC_URI="http://ftp.gnu.org/gnu/tar/${P}.tar.bz2
+ ftp://alpha.gnu.org/gnu/tar/${P}.tar.bz2
+ mirror://gnu/tar/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="nls static userland_GNU"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( >=sys-devel/gettext-0.10.35 )"
+
+RESTRICT="test" # Remove this from 1.25
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.23-strncpy.patch #317139
+ epatch "${FILESDIR}"/${P}-mkdirat.patch #342735
+ epatch "${FILESDIR}"/${P}-transform{,-2}.patch #342785
+
+ if ! use userland_GNU ; then
+ sed -i \
+ -e 's:/backup\.sh:/gbackup.sh:' \
+ scripts/{backup,dump-remind,restore}.in \
+ || die "sed non-GNU"
+ fi
+}
+
+src_configure() {
+ local myconf
+ use static && append-ldflags -static
+ use userland_GNU || myconf="--program-prefix=g"
+ # Work around bug in sandbox #67051
+ gl_cv_func_chown_follows_symlink=yes \
+ FORCE_UNSAFE_CONFIGURE=1 \
+ econf \
+ --enable-backup-scripts \
+ --bindir=/bin \
+ --libexecdir=/usr/sbin \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_install() {
+ local p=""
+ use userland_GNU || p=g
+
+ emake DESTDIR="${D}" install || die
+
+ if [[ -z ${p} ]] ; then
+ # a nasty yet required piece of baggage
+ exeinto /etc
+ doexe "${FILESDIR}"/rmt || die
+ fi
+
+ dodoc AUTHORS ChangeLog* NEWS README* THANKS
+ newman "${FILESDIR}"/tar.1 ${p}tar.1
+ mv "${D}"/usr/sbin/${p}backup{,-tar}
+ mv "${D}"/usr/sbin/${p}restore{,-tar}
+
+ rm -f "${D}"/usr/$(get_libdir)/charset.alias
+}