Compare commits
No commits in common. "6b57556109da820d47d8c3db67df36dd4887596d" and "df9ae904f8fb04c6c4c7b342bf67847d205ce3de" have entirely different histories.
6b57556109
...
df9ae904f8
129
backport-CVE-2021-20193.patch
Normal file
129
backport-CVE-2021-20193.patch
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
From d9d4435692150fa8ff68e1b1a473d187cc3fd777 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sergey Poznyakoff <gray@gnu.org>
|
||||||
|
Date: Sun, 17 Jan 2021 20:41:11 +0200
|
||||||
|
Subject: Fix memory leak in read_header
|
||||||
|
|
||||||
|
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=d9d4435692150fa8ff68e1b1a473d187cc3fd777
|
||||||
|
|
||||||
|
Bug reported in https://savannah.gnu.org/bugs/?59897
|
||||||
|
|
||||||
|
* src/list.c (read_header): Don't return directly from the loop.
|
||||||
|
Instead set the status and break. Return the status. Free
|
||||||
|
next_long_name and next_long_link before returning.
|
||||||
|
---
|
||||||
|
src/list.c | 40 ++++++++++++++++++++++++++++------------
|
||||||
|
1 file changed, 28 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/list.c b/src/list.c
|
||||||
|
index e40a5c8..d7ef441 100644
|
||||||
|
--- a/src/list.c
|
||||||
|
+++ b/src/list.c
|
||||||
|
@@ -408,26 +408,27 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
enum read_header_mode mode)
|
||||||
|
{
|
||||||
|
union block *header;
|
||||||
|
- union block *header_copy;
|
||||||
|
char *bp;
|
||||||
|
union block *data_block;
|
||||||
|
size_t size, written;
|
||||||
|
- union block *next_long_name = 0;
|
||||||
|
- union block *next_long_link = 0;
|
||||||
|
+ union block *next_long_name = NULL;
|
||||||
|
+ union block *next_long_link = NULL;
|
||||||
|
size_t next_long_name_blocks = 0;
|
||||||
|
size_t next_long_link_blocks = 0;
|
||||||
|
-
|
||||||
|
+ enum read_header status = HEADER_SUCCESS;
|
||||||
|
+
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
- enum read_header status;
|
||||||
|
-
|
||||||
|
header = find_next_block ();
|
||||||
|
*return_block = header;
|
||||||
|
if (!header)
|
||||||
|
- return HEADER_END_OF_FILE;
|
||||||
|
+ {
|
||||||
|
+ status = HEADER_END_OF_FILE;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if ((status = tar_checksum (header, false)) != HEADER_SUCCESS)
|
||||||
|
- return status;
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
/* Good block. Decode file size and return. */
|
||||||
|
|
||||||
|
@@ -437,7 +438,10 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
{
|
||||||
|
info->stat.st_size = OFF_FROM_HEADER (header->header.size);
|
||||||
|
if (info->stat.st_size < 0)
|
||||||
|
- return HEADER_FAILURE;
|
||||||
|
+ {
|
||||||
|
+ status = HEADER_FAILURE;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (header->header.typeflag == GNUTYPE_LONGNAME
|
||||||
|
@@ -447,10 +451,14 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
|| header->header.typeflag == SOLARIS_XHDTYPE)
|
||||||
|
{
|
||||||
|
if (mode == read_header_x_raw)
|
||||||
|
- return HEADER_SUCCESS_EXTENDED;
|
||||||
|
+ {
|
||||||
|
+ status = HEADER_SUCCESS_EXTENDED;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
else if (header->header.typeflag == GNUTYPE_LONGNAME
|
||||||
|
|| header->header.typeflag == GNUTYPE_LONGLINK)
|
||||||
|
{
|
||||||
|
+ union block *header_copy;
|
||||||
|
size_t name_size = info->stat.st_size;
|
||||||
|
size_t n = name_size % BLOCKSIZE;
|
||||||
|
size = name_size + BLOCKSIZE;
|
||||||
|
@@ -517,7 +525,10 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
xheader_decode_global (&xhdr);
|
||||||
|
xheader_destroy (&xhdr);
|
||||||
|
if (mode == read_header_x_global)
|
||||||
|
- return HEADER_SUCCESS_EXTENDED;
|
||||||
|
+ {
|
||||||
|
+ status = HEADER_SUCCESS_EXTENDED;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Loop! */
|
||||||
|
@@ -536,6 +547,7 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
name = next_long_name->buffer + BLOCKSIZE;
|
||||||
|
recent_long_name = next_long_name;
|
||||||
|
recent_long_name_blocks = next_long_name_blocks;
|
||||||
|
+ next_long_name = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -567,6 +579,7 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
name = next_long_link->buffer + BLOCKSIZE;
|
||||||
|
recent_long_link = next_long_link;
|
||||||
|
recent_long_link_blocks = next_long_link_blocks;
|
||||||
|
+ next_long_link = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -578,9 +591,12 @@ read_header (union block **return_block, struct tar_stat_info *info,
|
||||||
|
}
|
||||||
|
assign_string (&info->link_name, name);
|
||||||
|
|
||||||
|
- return HEADER_SUCCESS;
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ free (next_long_name);
|
||||||
|
+ free (next_long_link);
|
||||||
|
+ return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ISOCTAL(c) ((c)>='0'&&(c)<='7')
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
From 1d530107a24d71e798727d7f0afa0833473d1074 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Matej Mužila <mmuzila@gmail.com>
|
|
||||||
Date: Wed, 11 Jan 2023 08:55:58 +0100
|
|
||||||
Subject: [PATCH] Fix savannah bug #62387
|
|
||||||
|
|
||||||
* src/list.c (from_header): Check for the end of field after leading byte
|
|
||||||
(0x80 or 0xff) of base-256 encoded header value
|
|
||||||
---
|
|
||||||
src/list.c | 6 ++++++
|
|
||||||
1 file changed, 6 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/src/list.c b/src/list.c
|
|
||||||
index 9fafc425..bf41b581 100644
|
|
||||||
--- a/src/list.c
|
|
||||||
+++ b/src/list.c
|
|
||||||
@@ -899,6 +899,12 @@ from_header (char const *where0, size_t digs, char const *type,
|
|
||||||
<< (CHAR_BIT * sizeof (uintmax_t)
|
|
||||||
- LG_256 - (LG_256 - 2)));
|
|
||||||
value = (*where++ & ((1 << (LG_256 - 2)) - 1)) - signbit;
|
|
||||||
+ if (where == lim)
|
|
||||||
+ {
|
|
||||||
+ if (type && !silent)
|
|
||||||
+ ERROR ((0, 0, _("Archive base-256 value is invalid")));
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
value = (value << LG_256) + (unsigned char) *where++;
|
|
||||||
--
|
|
||||||
2.38.1
|
|
||||||
|
|
||||||
@ -16,13 +16,13 @@ http://lists.gnu.org/archive/html/bug-tar/2009-06/msg00016.html
|
|||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/src/create.c b/src/create.c
|
diff --git a/src/create.c b/src/create.c
|
||||||
index d20178c..b31fbe5 100644
|
index 6c99c74..4ee8334 100644
|
||||||
--- a/src/create.c
|
--- a/src/create.c
|
||||||
+++ b/src/create.c
|
+++ b/src/create.c
|
||||||
@@ -1851,7 +1851,8 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
|
@@ -1840,7 +1840,8 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
|
||||||
}
|
}
|
||||||
else if (atime_preserve_option == replace_atime_preserve
|
else if (atime_preserve_option == replace_atime_preserve
|
||||||
&& timespec_cmp (st->atime, get_stat_atime (&st2)) != 0
|
&& fd && (is_dir || original_size != 0)
|
||||||
- && set_file_atime (fd, parentfd, name, st->atime) != 0)
|
- && set_file_atime (fd, parentfd, name, st->atime) != 0)
|
||||||
+ && set_file_atime (fd, parentfd, name, st->atime) != 0
|
+ && set_file_atime (fd, parentfd, name, st->atime) != 0
|
||||||
+ && errno != EROFS )
|
+ && errno != EROFS )
|
||||||
@ -30,5 +30,5 @@ index d20178c..b31fbe5 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
2.41.0
|
1.8.3.1
|
||||||
|
|
||||||
|
|||||||
@ -14,10 +14,10 @@ Resolves: #206841
|
|||||||
3 files changed, 10 insertions(+), 11 deletions(-)
|
3 files changed, 10 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
diff --git a/doc/tar.texi b/doc/tar.texi
|
diff --git a/doc/tar.texi b/doc/tar.texi
|
||||||
index a8969e0..0185157 100644
|
index fba10ae..ff002a9 100644
|
||||||
--- a/doc/tar.texi
|
--- a/doc/tar.texi
|
||||||
+++ b/doc/tar.texi
|
+++ b/doc/tar.texi
|
||||||
@@ -8439,7 +8439,7 @@ The following table summarizes pattern-matching default values:
|
@@ -8437,7 +8437,7 @@ The following table summarizes pattern-matching default values:
|
||||||
|
|
||||||
@multitable @columnfractions .3 .7
|
@multitable @columnfractions .3 .7
|
||||||
@headitem Members @tab Default settings
|
@headitem Members @tab Default settings
|
||||||
@ -26,7 +26,7 @@ index a8969e0..0185157 100644
|
|||||||
@item Exclusion @tab @option{--wildcards --no-anchored --wildcards-match-slash}
|
@item Exclusion @tab @option{--wildcards --no-anchored --wildcards-match-slash}
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
||||||
@@ -12915,6 +12915,9 @@ version of this document is available at
|
@@ -12948,6 +12948,9 @@ is available at
|
||||||
@table @asis
|
@table @asis
|
||||||
@item Use of globbing patterns when listing and extracting.
|
@item Use of globbing patterns when listing and extracting.
|
||||||
|
|
||||||
@ -37,19 +37,19 @@ index a8969e0..0185157 100644
|
|||||||
extracting from or listing an archive. For example:
|
extracting from or listing an archive. For example:
|
||||||
|
|
||||||
diff --git a/src/names.c b/src/names.c
|
diff --git a/src/names.c b/src/names.c
|
||||||
index 037b869..d96ad71 100644
|
index 272653d..a592faa 100644
|
||||||
--- a/src/names.c
|
--- a/src/names.c
|
||||||
+++ b/src/names.c
|
+++ b/src/names.c
|
||||||
@@ -146,7 +146,7 @@ static struct argp_option names_options[] = {
|
@@ -142,7 +142,7 @@ static struct argp_option names_options[] = {
|
||||||
|
{"no-ignore-case", NO_IGNORE_CASE_OPTION, 0, 0,
|
||||||
|
N_("case sensitive matching (default)"), GRID_MATCH },
|
||||||
|
{"wildcards", WILDCARDS_OPTION, 0, 0,
|
||||||
|
- N_("use wildcards (default for exclusion)"), GRID_MATCH },
|
||||||
|
+ N_("use wildcards (default)"), GRID_MATCH },
|
||||||
{"no-wildcards", NO_WILDCARDS_OPTION, 0, 0,
|
{"no-wildcards", NO_WILDCARDS_OPTION, 0, 0,
|
||||||
N_("verbatim string matching"), GRID_MATCH },
|
N_("verbatim string matching"), GRID_MATCH },
|
||||||
{"wildcards-match-slash", WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
|
{"wildcards-match-slash", WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
|
||||||
- N_("wildcards match '/' (default for exclusion)"), GRID_MATCH },
|
@@ -225,8 +225,7 @@ names_parse_opt (int key, char *arg, struct argp_state *state)
|
||||||
+ N_("wildcards match '/' (default)"), GRID_MATCH },
|
|
||||||
{"no-wildcards-match-slash", NO_WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
|
|
||||||
N_("wildcards do not match '/'"), GRID_MATCH },
|
|
||||||
|
|
||||||
@@ -195,8 +195,7 @@ names_parse_opt (int key, char *arg, struct argp_state *state)
|
|
||||||
/* Wildcard matching settings */
|
/* Wildcard matching settings */
|
||||||
enum wildcards
|
enum wildcards
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ index 037b869..d96ad71 100644
|
|||||||
disable_wildcards,
|
disable_wildcards,
|
||||||
enable_wildcards
|
enable_wildcards
|
||||||
};
|
};
|
||||||
@@ -214,7 +213,7 @@ static int include_anchored = EXCLUDE_ANCHORED;
|
@@ -244,7 +243,7 @@ static int include_anchored = EXCLUDE_ANCHORED;
|
||||||
| recursion_option)
|
| recursion_option)
|
||||||
|
|
||||||
#define INCLUDE_OPTIONS \
|
#define INCLUDE_OPTIONS \
|
||||||
@ -68,7 +68,7 @@ index 037b869..d96ad71 100644
|
|||||||
| include_anchored \
|
| include_anchored \
|
||||||
| matching_flags \
|
| matching_flags \
|
||||||
| recursion_option)
|
| recursion_option)
|
||||||
@@ -1234,8 +1233,7 @@ regex_usage_warning (const char *name)
|
@@ -1393,8 +1392,7 @@ regex_usage_warning (const char *name)
|
||||||
|
|
||||||
/* Warn about implicit use of the wildcards in command line arguments.
|
/* Warn about implicit use of the wildcards in command line arguments.
|
||||||
(Default for tar prior to 1.15.91, but changed afterwards) */
|
(Default for tar prior to 1.15.91, but changed afterwards) */
|
||||||
@ -78,7 +78,7 @@ index 037b869..d96ad71 100644
|
|||||||
{
|
{
|
||||||
warned_once = 1;
|
warned_once = 1;
|
||||||
WARN ((0, 0,
|
WARN ((0, 0,
|
||||||
@@ -1618,10 +1616,7 @@ collect_and_sort_names (void)
|
@@ -1768,10 +1766,7 @@ collect_and_sort_names (void)
|
||||||
|
|
||||||
if (name->found_count || name->directory)
|
if (name->found_count || name->directory)
|
||||||
continue;
|
continue;
|
||||||
@ -91,7 +91,7 @@ index 037b869..d96ad71 100644
|
|||||||
|
|
||||||
if (name->name[0] == 0)
|
if (name->name[0] == 0)
|
||||||
diff --git a/tests/exclude01.at b/tests/exclude01.at
|
diff --git a/tests/exclude01.at b/tests/exclude01.at
|
||||||
index c3cd10b..c590047 100644
|
index a813c6e..3a546fc 100644
|
||||||
--- a/tests/exclude01.at
|
--- a/tests/exclude01.at
|
||||||
+++ b/tests/exclude01.at
|
+++ b/tests/exclude01.at
|
||||||
@@ -61,6 +61,7 @@ testdir/dir2/file2
|
@@ -61,6 +61,7 @@ testdir/dir2/file2
|
||||||
@ -103,5 +103,5 @@ index c3cd10b..c590047 100644
|
|||||||
testdir/dir1/*
|
testdir/dir1/*
|
||||||
NEXT
|
NEXT
|
||||||
--
|
--
|
||||||
2.5.5
|
1.8.3.1
|
||||||
|
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
From: Pavel Raiskup <praiskup@redhat.com>
|
|
||||||
Date: Tue, 16 Feb 2021 08:10:22 +0100
|
|
||||||
Subject: [PATCH] Related discussion in the Fedora pull-request:
|
|
||||||
https://src.fedoraproject.org/rpms/tar/pull-request/8
|
|
||||||
|
|
||||||
Upstream report:
|
|
||||||
https://www.mail-archive.com/bug-tar@gnu.org/msg05943.html
|
|
||||||
|
|
||||||
* tests/capabs_raw01.at: Newer systems (currently e.g. Fedora 34)
|
|
||||||
print getcap output in format CAP=VAL, not CAP+VAL.
|
|
||||||
---
|
|
||||||
tests/capabs_raw01.at | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/capabs_raw01.at b/tests/capabs_raw01.at
|
|
||||||
index a1d9411..d3da923 100644
|
|
||||||
--- a/tests/capabs_raw01.at
|
|
||||||
+++ b/tests/capabs_raw01.at
|
|
||||||
@@ -45,10 +45,10 @@ rm -rf dir
|
|
||||||
tar --xattrs --xattrs-include='*' -xf archive.tar
|
|
||||||
|
|
||||||
# Newer systems print = instead of + here
|
|
||||||
-getcap dir/file | sed 's/+/=/'
|
|
||||||
+getcap dir/file | sed -e 's/+/=/' -e 's|dir/file = |dir/file |'
|
|
||||||
],
|
|
||||||
[0],
|
|
||||||
-[dir/file = cap_chown=ei
|
|
||||||
+[dir/file cap_chown=ei
|
|
||||||
])
|
|
||||||
|
|
||||||
AT_CLEANUP
|
|
||||||
--
|
|
||||||
2.26.0
|
|
||||||
|
|
||||||
BIN
tar-1.34.tar.xz
Normal file
BIN
tar-1.34.tar.xz
Normal file
Binary file not shown.
7
tar-1.34.tar.xz.sig
Normal file
7
tar-1.34.tar.xz.sig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
Version: GnuPG v1
|
||||||
|
|
||||||
|
iEYEABECAAYFAmAnuBMACgkQNgKwf1XQxzJIVgCfR5Z7coRkU2+aOW4KNhumGl/1
|
||||||
|
jn4AoI9OuQPpyzZN1CIwejDYxbV7u59P
|
||||||
|
=mfma
|
||||||
|
-----END PGP SIGNATURE-----
|
||||||
@ -1,156 +0,0 @@
|
|||||||
From 7fac753fb6e6c0459788ee9015b984dba1de5402 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lukas Javorsky <ljavorsk@redhat.com>
|
|
||||||
Date: Tue, 18 Jul 2023 14:10:12 +0000
|
|
||||||
Subject: [PATCH] Add exclude17 and exclude18 tests which were forgotten by
|
|
||||||
upstream
|
|
||||||
|
|
||||||
Sources:
|
|
||||||
*https://git.savannah.gnu.org/cgit/tar.git/tree/tests/exclude17.at
|
|
||||||
*https://git.savannah.gnu.org/cgit/tar.git/tree/tests/exclude18.at
|
|
||||||
|
|
||||||
Repoted to upstream in ML:
|
|
||||||
*https://lists.gnu.org/archive/html/bug-tar/2023-07/msg00002.html
|
|
||||||
---
|
|
||||||
tests/exclude17.at | 35 +++++++++++++++++++
|
|
||||||
tests/exclude18.at | 87 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
2 files changed, 122 insertions(+)
|
|
||||||
create mode 100644 tests/exclude17.at
|
|
||||||
create mode 100644 tests/exclude18.at
|
|
||||||
|
|
||||||
diff --git a/tests/exclude17.at b/tests/exclude17.at
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..5539ef3
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/exclude17.at
|
|
||||||
@@ -0,0 +1,35 @@
|
|
||||||
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
||||||
+#
|
|
||||||
+# Test suite for GNU tar.
|
|
||||||
+# Copyright 2013-2023 Free Software Foundation, Inc.
|
|
||||||
+
|
|
||||||
+# This file is part of GNU tar.
|
|
||||||
+
|
|
||||||
+# GNU tar is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 3 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+
|
|
||||||
+# GNU tar is distributed in the hope that it will be useful,
|
|
||||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
+# GNU General Public License for more details.
|
|
||||||
+
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
+
|
|
||||||
+AT_SETUP([--exclude-vcs-ignores memory allocation])
|
|
||||||
+AT_KEYWORDS([exclude exclude17])
|
|
||||||
+
|
|
||||||
+AT_TAR_CHECK([
|
|
||||||
+mkdir dir
|
|
||||||
+cd dir
|
|
||||||
+echo '*.o' >.cvsignore
|
|
||||||
+tar -cf - --exclude-vcs-ignores . | tar -tf -
|
|
||||||
+],
|
|
||||||
+[0],
|
|
||||||
+[./
|
|
||||||
+./.cvsignore
|
|
||||||
+])
|
|
||||||
+
|
|
||||||
+AT_CLEANUP
|
|
||||||
diff --git a/tests/exclude18.at b/tests/exclude18.at
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..64aaa52
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/exclude18.at
|
|
||||||
@@ -0,0 +1,87 @@
|
|
||||||
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
||||||
+
|
|
||||||
+# Test suite for GNU tar.
|
|
||||||
+# Copyright 2004-2023 Free Software Foundation, Inc.
|
|
||||||
+
|
|
||||||
+# This file is part of GNU tar.
|
|
||||||
+
|
|
||||||
+# GNU tar is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 3 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+
|
|
||||||
+# GNU tar is distributed in the hope that it will be useful,
|
|
||||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
+# GNU General Public License for more details.
|
|
||||||
+
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
+
|
|
||||||
+# Test --exclude-vcs option with subcommands: EXTRACT, LIST, DIFF.
|
|
||||||
+# Check VCS directory with files, and empty.
|
|
||||||
+#
|
|
||||||
+# Ref: https://savannah.gnu.org/bugs/?62859
|
|
||||||
+# Wed 03 Aug 2022 04:06:28 PM UTC, original submission: Quote
|
|
||||||
+# Mohamed Akram <mohdakram>
|
|
||||||
+# > The --exclude-vcs flag seems to exclude .gitignore but not .git when
|
|
||||||
+# extracting.
|
|
||||||
+
|
|
||||||
+AT_SETUP([--exclude-vcs extract list compare])
|
|
||||||
+AT_KEYWORDS([exclude-vcs extract list compare exclude18])
|
|
||||||
+
|
|
||||||
+AT_TAR_CHECK([
|
|
||||||
+AT_SORT_PREREQ
|
|
||||||
+mkdir gitrepo
|
|
||||||
+cd gitrepo
|
|
||||||
+
|
|
||||||
+# Make an empty VCS directory:
|
|
||||||
+mkdir .svn
|
|
||||||
+
|
|
||||||
+# Make a VCS directory with a file:
|
|
||||||
+mkdir .git
|
|
||||||
+touch .git/_A
|
|
||||||
+
|
|
||||||
+# Make a VCS file:
|
|
||||||
+touch .gitignore
|
|
||||||
+
|
|
||||||
+# Make non-VCS files:
|
|
||||||
+touch .git_B
|
|
||||||
+touch _C
|
|
||||||
+
|
|
||||||
+# Create an archive, include VCS:
|
|
||||||
+cd ..
|
|
||||||
+tar -cf gitrepo.tar gitrepo
|
|
||||||
+rm -r gitrepo
|
|
||||||
+
|
|
||||||
+echo Extract:
|
|
||||||
+tar -xvf gitrepo.tar --exclude-vcs | sort
|
|
||||||
+
|
|
||||||
+echo
|
|
||||||
+echo List:
|
|
||||||
+tar -tf gitrepo.tar --exclude-vcs | sort
|
|
||||||
+
|
|
||||||
+echo
|
|
||||||
+echo Diff:
|
|
||||||
+tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort
|
|
||||||
+
|
|
||||||
+],
|
|
||||||
+[0],
|
|
||||||
+[Extract:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+
|
|
||||||
+List:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+
|
|
||||||
+Diff:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+],
|
|
||||||
+[])
|
|
||||||
+
|
|
||||||
+AT_CLEANUP
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
From d437ecf75de2d6fdeb2aed6f45c4b3b16373389b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sergey Poznyakoff <gray@gnu.org>
|
|
||||||
Date: Fri, 11 Aug 2023 21:35:30 +0300
|
|
||||||
Subject: [PATCH] Revert "Fix savannah bug #63567"
|
|
||||||
|
|
||||||
Commit e89c7a45eb broke deletion from archives. The reported number
|
|
||||||
of bytes read is rounded to the nearest record anyway, revert the
|
|
||||||
commit and document the fact.
|
|
||||||
|
|
||||||
Reported by Ed Santiago. See
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2230127
|
|
||||||
|
|
||||||
* doc/tar.texi: Document the fact that --totals rounds up the
|
|
||||||
number of bytes reads to the nearest record.
|
|
||||||
* src/buffer.c: Revert changes.
|
|
||||||
* tests/delete06.at: Fix expected status code and stderr.
|
|
||||||
---
|
|
||||||
doc/tar.texi | 5 +++++
|
|
||||||
src/buffer.c | 3 +--
|
|
||||||
tests/delete06.at | 7 +++++--
|
|
||||||
3 files changed, 11 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/tar.texi b/doc/tar.texi
|
|
||||||
index d43b39e4..ee631137 100644
|
|
||||||
--- a/doc/tar.texi
|
|
||||||
+++ b/doc/tar.texi
|
|
||||||
@@ -4215,6 +4215,11 @@ Total bytes read: 7924664320 (7.4GiB, 95MiB/s)
|
|
||||||
@end group
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
+Notice, that since @command{tar} operates on @dfn{records}, the number
|
|
||||||
+of bytes reported can be rounded up to the nearest full record. This
|
|
||||||
+can happen, in particular, when the last record in the archive is
|
|
||||||
+partial. @xref{Blocking}.
|
|
||||||
+
|
|
||||||
Finally, when deleting from an archive, the @option{--totals} option
|
|
||||||
displays both numbers plus number of bytes removed from the archive:
|
|
||||||
|
|
||||||
diff --git a/src/buffer.c b/src/buffer.c
|
|
||||||
index 12a0579f..8a575f9a 100644
|
|
||||||
--- a/src/buffer.c
|
|
||||||
+++ b/src/buffer.c
|
|
||||||
@@ -987,8 +987,7 @@ short_read (size_t status)
|
|
||||||
}
|
|
||||||
|
|
||||||
record_end = record_start + (record_size - left) / BLOCKSIZE;
|
|
||||||
- if (left == 0)
|
|
||||||
- records_read++;
|
|
||||||
+ records_read++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Flush the current buffer to/from the archive. */
|
|
||||||
diff --git a/tests/delete06.at b/tests/delete06.at
|
|
||||||
index 9668a28c..c84ba20e 100644
|
|
||||||
--- a/tests/delete06.at
|
|
||||||
+++ b/tests/delete06.at
|
|
||||||
@@ -36,7 +36,10 @@ esac
|
|
||||||
dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null
|
|
||||||
tar --delete 'b/' -f trunc.tar
|
|
||||||
],
|
|
||||||
-[0],
|
|
||||||
-[],[],[],[],[gnu, pax])
|
|
||||||
+[2],
|
|
||||||
+[],
|
|
||||||
+[tar: lseek: trunc.tar: Value too large for defined data type
|
|
||||||
+tar: Exiting with failure status due to previous errors
|
|
||||||
+],[],[],[gnu, pax])
|
|
||||||
|
|
||||||
AT_CLEANUP
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
||||||
BIN
tar-1.35.tar.xz
BIN
tar-1.35.tar.xz
Binary file not shown.
Binary file not shown.
@ -1,60 +0,0 @@
|
|||||||
From 7e8239c9e6dd50431f221d72716b20c0411eab0e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Wu Zixuan <wuzx1226@qq.com>
|
|
||||||
Date: Thu, 24 Nov 2022 14:59:00 +0800
|
|
||||||
Subject: [PATCH] Add sw64 architecture
|
|
||||||
|
|
||||||
Add sw64 architecture in file m4/host-cpu-c-abi.m4 to support sw64 architecture.
|
|
||||||
|
|
||||||
Signed-off-by: wzx <wuzx1226@qq.com>
|
|
||||||
---
|
|
||||||
m4/host-cpu-c-abi.m4 | 13 +++++++++++--
|
|
||||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
|
|
||||||
index 7dc830e..b4c0830 100644
|
|
||||||
--- a/m4/host-cpu-c-abi.m4
|
|
||||||
+++ b/m4/host-cpu-c-abi.m4
|
|
||||||
@@ -90,6 +90,12 @@ changequote([,])dnl
|
|
||||||
[gl_cv_host_cpu_c_abi=i386])
|
|
||||||
;;
|
|
||||||
|
|
||||||
+changequote(,)dnl
|
|
||||||
+ sw_64* )
|
|
||||||
+changequote([,])dnl
|
|
||||||
+ gl_cv_host_cpu_c_abi=sw_64
|
|
||||||
+ ;;
|
|
||||||
+
|
|
||||||
changequote(,)dnl
|
|
||||||
alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
|
|
||||||
changequote([,])dnl
|
|
||||||
@@ -355,6 +361,9 @@ EOF
|
|
||||||
#ifndef __x86_64__
|
|
||||||
#undef __x86_64__
|
|
||||||
#endif
|
|
||||||
+#ifndef __sw_64__
|
|
||||||
+#undef __sw_64__
|
|
||||||
+#endif
|
|
||||||
#ifndef __alpha__
|
|
||||||
#undef __alpha__
|
|
||||||
#endif
|
|
||||||
@@ -468,7 +477,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
|
|
||||||
case "$gl_cv_host_cpu_c_abi" in
|
|
||||||
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
|
|
||||||
gl_cv_host_cpu_c_abi_32bit=yes ;;
|
|
||||||
- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
|
|
||||||
+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
|
|
||||||
gl_cv_host_cpu_c_abi_32bit=no ;;
|
|
||||||
*)
|
|
||||||
gl_cv_host_cpu_c_abi_32bit=unknown ;;
|
|
||||||
@@ -498,7 +507,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
|
|
||||||
|
|
||||||
# CPUs that only support a 64-bit ABI.
|
|
||||||
changequote(,)dnl
|
|
||||||
- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
|
|
||||||
+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
|
|
||||||
| mmix )
|
|
||||||
changequote([,])dnl
|
|
||||||
gl_cv_host_cpu_c_abi_32bit=no
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
21
tar.spec
21
tar.spec
@ -1,5 +1,5 @@
|
|||||||
Name: tar
|
Name: tar
|
||||||
Version: 1.35
|
Version: 1.34
|
||||||
Release: 2
|
Release: 2
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Summary: An organized and systematic method of controlling a large amount of data
|
Summary: An organized and systematic method of controlling a large amount of data
|
||||||
@ -12,18 +12,11 @@ BuildRequires: autoconf automake texinfo gettext libacl-devel attr acl policycor
|
|||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
Provides: bundled(gnulib) /bin/tar /bin/gtar
|
Provides: bundled(gnulib) /bin/tar /bin/gtar
|
||||||
|
|
||||||
Patch6000: backport-CVE-2022-48303.patch
|
|
||||||
|
|
||||||
Patch0001: tar-1.28-loneZeroWarning.patch
|
Patch0001: tar-1.28-loneZeroWarning.patch
|
||||||
Patch0002: tar-1.28-vfatTruncate.patch
|
Patch0002: tar-1.28-vfatTruncate.patch
|
||||||
Patch0003: tar-1.29-wildcards.patch
|
Patch0003: tar-1.29-wildcards.patch
|
||||||
Patch0004: tar-1.28-atime-rofs.patch
|
Patch0004: tar-1.28-atime-rofs.patch
|
||||||
Patch0005: tar-1.28-document-exclude-mistakes.patch
|
Patch0005: tar-1.28-document-exclude-mistakes.patch
|
||||||
Patch0006: tar-1.33-fix-capabilities-test.patch
|
|
||||||
Patch0007: tar-1.35-add-forgotten-tests-from-upstream.patch
|
|
||||||
Patch0008: tar-1.35-revert-fix-savannah-bug-633567.patch
|
|
||||||
|
|
||||||
Patch3000: tar-Add-sw64-architecture.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
GNU Tar provides the ability to create tar archives, as well as various other
|
GNU Tar provides the ability to create tar archives, as well as various other
|
||||||
@ -82,18 +75,6 @@ make check
|
|||||||
%{_infodir}/tar.info*
|
%{_infodir}/tar.info*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Aug 24 2023 dillon chen <dillon.chen@gmail.com> 2: 1.35-2
|
|
||||||
- get patches, test and verify
|
|
||||||
|
|
||||||
* Wed Jul 19 2023 dillon chen <dillon.chen@gmail.com> 2: 1.35-1
|
|
||||||
- update to 1.35-1
|
|
||||||
|
|
||||||
* Wed Feb 08 2023 wangjiang <wangjiang37@h-partners.com> 2:1.34-4
|
|
||||||
- fix CVE-2022-48303
|
|
||||||
|
|
||||||
* Fri Nov 11 2022 wuzx<wuzx1226@qq.com> - 2:1.34-3
|
|
||||||
- Add sw64 architecture
|
|
||||||
|
|
||||||
* Thu Oct 27 2022 dongyuzhen <dongyuzhen@h-partners.com> - 2:1.34-2
|
* Thu Oct 27 2022 dongyuzhen <dongyuzhen@h-partners.com> - 2:1.34-2
|
||||||
- Rebuild for next release
|
- Rebuild for next release
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user