Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
Date: Sat, 23 Feb 2019 19:15:26
Message-Id: 1550949314.b361e7a6af7e5b907d2a7699c6c2a6592aa451c0.polynomial-c@gentoo
1 commit: b361e7a6af7e5b907d2a7699c6c2a6592aa451c0
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 23 19:11:49 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 23 19:15:14 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b361e7a6
7
8 app-arch/tar: Removed old.
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 app-arch/tar/files/tar-1.30-CVE-2018-20482.patch | 146 -----------------------
14 app-arch/tar/tar-1.30-r1.ebuild | 82 -------------
15 2 files changed, 228 deletions(-)
16
17 diff --git a/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch b/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch
18 deleted file mode 100644
19 index 8abab5df6c0..00000000000
20 --- a/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch
21 +++ /dev/null
22 @@ -1,146 +0,0 @@
23 -From c15c42ccd1e2377945fd0414eca1a49294bff454 Mon Sep 17 00:00:00 2001
24 -From: Sergey Poznyakoff <gray@×××.org>
25 -Date: Thu, 27 Dec 2018 17:48:57 +0200
26 -Subject: Fix CVE-2018-20482
27 -
28 -* src/sparse.c (sparse_dump_region): Handle short read condition.
29 -(sparse_extract_region,check_data_region): Fix dumped_size calculation.
30 -Handle short read condition.
31 -(pax_decode_header): Fix dumped_size calculation.
32 -
33 -diff --git a/src/sparse.c b/src/sparse.c
34 -index d41c0ea..f611200 100644
35 ---- a/src/sparse.c
36 -+++ b/src/sparse.c
37 -@@ -1,6 +1,6 @@
38 - /* Functions for dealing with sparse files
39 -
40 -- Copyright 2003-2007, 2010, 2013-2017 Free Software Foundation, Inc.
41 -+ Copyright 2003-2007, 2010, 2013-2018 Free Software Foundation, Inc.
42 -
43 - This program is free software; you can redistribute it and/or modify it
44 - under the terms of the GNU General Public License as published by the
45 -@@ -427,6 +427,30 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i)
46 - bufsize);
47 - return false;
48 - }
49 -+ else if (bytes_read == 0)
50 -+ {
51 -+ char buf[UINTMAX_STRSIZE_BOUND];
52 -+ struct stat st;
53 -+ size_t n;
54 -+ if (fstat (file->fd, &st) == 0)
55 -+ n = file->stat_info->stat.st_size - st.st_size;
56 -+ else
57 -+ n = file->stat_info->stat.st_size
58 -+ - (file->stat_info->sparse_map[i].offset
59 -+ + file->stat_info->sparse_map[i].numbytes
60 -+ - bytes_left);
61 -+
62 -+ WARNOPT (WARN_FILE_SHRANK,
63 -+ (0, 0,
64 -+ ngettext ("%s: File shrank by %s byte; padding with zeros",
65 -+ "%s: File shrank by %s bytes; padding with zeros",
66 -+ n),
67 -+ quotearg_colon (file->stat_info->orig_file_name),
68 -+ STRINGIFY_BIGINT (n, buf)));
69 -+ if (! ignore_failed_read_option)
70 -+ set_exit_status (TAREXIT_DIFFERS);
71 -+ return false;
72 -+ }
73 -
74 - memset (blk->buffer + bytes_read, 0, BLOCKSIZE - bytes_read);
75 - bytes_left -= bytes_read;
76 -@@ -464,9 +488,9 @@ sparse_extract_region (struct tar_sparse_file *file, size_t i)
77 - return false;
78 - }
79 - set_next_block_after (blk);
80 -+ file->dumped_size += BLOCKSIZE;
81 - count = blocking_write (file->fd, blk->buffer, wrbytes);
82 - write_size -= count;
83 -- file->dumped_size += count;
84 - mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
85 - file->offset += count;
86 - if (count != wrbytes)
87 -@@ -598,6 +622,12 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
88 - rdsize);
89 - return false;
90 - }
91 -+ else if (bytes_read == 0)
92 -+ {
93 -+ report_difference (file->stat_info, _("Size differs"));
94 -+ return false;
95 -+ }
96 -+
97 - if (!zero_block_p (diff_buffer, bytes_read))
98 - {
99 - char begbuf[INT_BUFSIZE_BOUND (off_t)];
100 -@@ -609,6 +639,7 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
101 -
102 - beg += bytes_read;
103 - }
104 -+
105 - return true;
106 - }
107 -
108 -@@ -635,6 +666,7 @@ check_data_region (struct tar_sparse_file *file, size_t i)
109 - return false;
110 - }
111 - set_next_block_after (blk);
112 -+ file->dumped_size += BLOCKSIZE;
113 - bytes_read = safe_read (file->fd, diff_buffer, rdsize);
114 - if (bytes_read == SAFE_READ_ERROR)
115 - {
116 -@@ -645,7 +677,11 @@ check_data_region (struct tar_sparse_file *file, size_t i)
117 - rdsize);
118 - return false;
119 - }
120 -- file->dumped_size += bytes_read;
121 -+ else if (bytes_read == 0)
122 -+ {
123 -+ report_difference (&current_stat_info, _("Size differs"));
124 -+ return false;
125 -+ }
126 - size_left -= bytes_read;
127 - mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
128 - if (memcmp (blk->buffer, diff_buffer, rdsize))
129 -@@ -1213,7 +1249,8 @@ pax_decode_header (struct tar_sparse_file *file)
130 - union block *blk;
131 - char *p;
132 - size_t i;
133 --
134 -+ off_t start;
135 -+
136 - #define COPY_BUF(b,buf,src) do \
137 - { \
138 - char *endp = b->buffer + BLOCKSIZE; \
139 -@@ -1229,7 +1266,6 @@ pax_decode_header (struct tar_sparse_file *file)
140 - if (src == endp) \
141 - { \
142 - set_next_block_after (b); \
143 -- file->dumped_size += BLOCKSIZE; \
144 - b = find_next_block (); \
145 - src = b->buffer; \
146 - endp = b->buffer + BLOCKSIZE; \
147 -@@ -1240,8 +1276,8 @@ pax_decode_header (struct tar_sparse_file *file)
148 - dst[-1] = 0; \
149 - } while (0)
150 -
151 -+ start = current_block_ordinal ();
152 - set_next_block_after (current_header);
153 -- file->dumped_size += BLOCKSIZE;
154 - blk = find_next_block ();
155 - p = blk->buffer;
156 - COPY_BUF (blk,nbuf,p);
157 -@@ -1278,6 +1314,8 @@ pax_decode_header (struct tar_sparse_file *file)
158 - sparse_add_map (file->stat_info, &sp);
159 - }
160 - set_next_block_after (blk);
161 -+
162 -+ file->dumped_size += BLOCKSIZE * (current_block_ordinal () - start);
163 - }
164 -
165 - return true;
166 ---
167 -cgit v1.0-41-gc330
168 -
169
170 diff --git a/app-arch/tar/tar-1.30-r1.ebuild b/app-arch/tar/tar-1.30-r1.ebuild
171 deleted file mode 100644
172 index 731db2be72c..00000000000
173 --- a/app-arch/tar/tar-1.30-r1.ebuild
174 +++ /dev/null
175 @@ -1,82 +0,0 @@
176 -# Copyright 1999-2019 Gentoo Authors
177 -# Distributed under the terms of the GNU General Public License v2
178 -
179 -EAPI=6
180 -
181 -inherit flag-o-matic
182 -
183 -DESCRIPTION="Use this to make tarballs :)"
184 -HOMEPAGE="https://www.gnu.org/software/tar/"
185 -SRC_URI="mirror://gnu/tar/${P}.tar.bz2
186 - mirror://gnu-alpha/tar/${P}.tar.bz2"
187 -
188 -LICENSE="GPL-3+"
189 -SLOT="0"
190 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
191 -IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
192 -
193 -RDEPEND="acl? ( virtual/acl )
194 - selinux? ( sys-libs/libselinux )"
195 -DEPEND="${RDEPEND}
196 - nls? ( >=sys-devel/gettext-0.10.35 )
197 - xattr? ( elibc_glibc? ( sys-apps/attr ) )"
198 -
199 -PATCHES=(
200 - "${FILESDIR}"/${P}-fix-test-92.patch
201 - "${FILESDIR}"/${P}-fix-test-117-and-118.patch
202 - "${FILESDIR}"/${P}-CVE-2018-20482.patch #674210
203 -)
204 -
205 -src_prepare() {
206 - default
207 -
208 - if ! use userland_GNU ; then
209 - sed -i \
210 - -e 's:/backup\.sh:/gbackup.sh:' \
211 - scripts/{backup,dump-remind,restore}.in \
212 - || die "sed non-GNU"
213 - fi
214 -}
215 -
216 -src_configure() {
217 - use static && append-ldflags -static
218 - local myeconfargs=(
219 - --bindir="${EPREFIX%/}"/bin
220 - --enable-backup-scripts
221 - --libexecdir="${EPREFIX%/}"/usr/sbin
222 - $(usex userland_GNU "" "--program-prefix=g")
223 - $(use_with acl posix-acls)
224 - $(use_enable nls)
225 - $(use_with selinux)
226 - $(use_with xattr xattrs)
227 - )
228 - FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
229 -}
230 -
231 -src_install() {
232 - default
233 -
234 - local p=$(usex userland_GNU "" "g")
235 - if [[ -z ${p} ]] ; then
236 - # a nasty yet required piece of baggage
237 - exeinto /etc
238 - doexe "${FILESDIR}"/rmt
239 - fi
240 -
241 - # autoconf looks for gtar before tar (in configure scripts), hence
242 - # in Prefix it is important that it is there, otherwise, a gtar from
243 - # the host system (FreeBSD, Solaris, Darwin) will be found instead
244 - # of the Prefix provided (GNU) tar
245 - if use prefix ; then
246 - dosym tar /bin/gtar
247 - fi
248 -
249 - mv "${ED%/}"/usr/sbin/${p}backup{,-tar} || die
250 - mv "${ED%/}"/usr/sbin/${p}restore{,-tar} || die
251 -
252 - if use minimal ; then
253 - find "${ED%/}"/etc "${ED%/}"/*bin/ "${ED%/}"/usr/*bin/ \
254 - -type f -a '!' '(' -name tar -o -name ${p}tar ')' \
255 - -delete || die
256 - fi
257 -}