Compare commits
No commits in common. 'c9' and 'c8' have entirely different histories.
@ -1 +1 @@
|
||||
SOURCES/tar-1.34.tar.xz
|
||||
SOURCES/tar-1.30.tar.xz
|
||||
|
@ -1 +1 @@
|
||||
bb9d853e10d0753fe9063914401a7e164d51a0f0 SOURCES/tar-1.34.tar.xz
|
||||
0d442c4565f8131745a5dff1cd08f7eaa797f679 SOURCES/tar-1.30.tar.xz
|
||||
|
@ -0,0 +1,129 @@
|
||||
From b451bfd224da44e93cf842f23455d755e48421dd Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Raiskup <praiskup@redhat.com>
|
||||
Date: Mon, 28 Jul 2014 08:17:55 +0200
|
||||
Subject: [PATCH 8/9] Fix for infinite loops during sparse file handling
|
||||
|
||||
Upstream bugreport (still downstream):
|
||||
http://www.mail-archive.com/bug-tar@gnu.org/msg04432.html
|
||||
|
||||
Resolves: #1082608
|
||||
|
||||
---
|
||||
THANKS | 1 +
|
||||
src/sparse.c | 48 ++++++++++++++++++++++++++++++++----------------
|
||||
2 files changed, 33 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/THANKS b/THANKS
|
||||
index b4c5427..e74f71c 100644
|
||||
--- a/THANKS
|
||||
+++ b/THANKS
|
||||
@@ -175,6 +175,7 @@ Fabio d'Alessi cars@civ.bio.unipd.it
|
||||
Frank Heckenbach frank@g-n-u.de
|
||||
Frank Koenen koenfr@lidp.com
|
||||
Franz-Werner Gergen gergen@edvulx.mpi-stuttgart.mpg.de
|
||||
+François Ouellet fouell@gmail.com
|
||||
François Pinard pinard@iro.umontreal.ca
|
||||
Fritz Elfert fritz@fsun.triltsch.de
|
||||
George Chyu gschyu@ccgate.dp.beckman.com
|
||||
diff --git a/src/sparse.c b/src/sparse.c
|
||||
index 6a97676..53c1868 100644
|
||||
--- a/src/sparse.c
|
||||
+++ b/src/sparse.c
|
||||
@@ -301,6 +301,7 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i)
|
||||
{
|
||||
union block *blk;
|
||||
off_t bytes_left = file->stat_info->sparse_map[i].numbytes;
|
||||
+ const char *file_name = file->stat_info->orig_file_name;
|
||||
|
||||
if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset))
|
||||
return false;
|
||||
@@ -314,13 +315,23 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i)
|
||||
bytes_read = safe_read (file->fd, blk->buffer, bufsize);
|
||||
if (bytes_read == SAFE_READ_ERROR)
|
||||
{
|
||||
- read_diag_details (file->stat_info->orig_file_name,
|
||||
+ read_diag_details (file_name,
|
||||
(file->stat_info->sparse_map[i].offset
|
||||
+ file->stat_info->sparse_map[i].numbytes
|
||||
- bytes_left),
|
||||
bufsize);
|
||||
return false;
|
||||
}
|
||||
+ if (bytes_read == 0)
|
||||
+ {
|
||||
+ char buf[UINTMAX_STRSIZE_BOUND];
|
||||
+ FATAL_ERROR ((0, 0,
|
||||
+ ngettext ("%s: File shrank by %s byte",
|
||||
+ "%s: File shrank by %s bytes",
|
||||
+ bytes_left),
|
||||
+ quotearg_colon (file_name),
|
||||
+ offtostr (bytes_left, buf)));
|
||||
+ }
|
||||
|
||||
memset (blk->buffer + bytes_read, 0, BLOCKSIZE - bytes_read);
|
||||
bytes_left -= bytes_read;
|
||||
@@ -475,33 +486,37 @@ sparse_skip_file (struct tar_stat_info *st)
|
||||
static bool
|
||||
check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
|
||||
{
|
||||
- if (!lseek_or_error (file, beg))
|
||||
+ off_t offset = beg;
|
||||
+
|
||||
+ if (!lseek_or_error (file, offset))
|
||||
return false;
|
||||
|
||||
- while (beg < end)
|
||||
+ while (offset < end)
|
||||
{
|
||||
size_t bytes_read;
|
||||
- size_t rdsize = BLOCKSIZE < end - beg ? BLOCKSIZE : end - beg;
|
||||
+ size_t rdsize = BLOCKSIZE < end - offset ? BLOCKSIZE : end - offset;
|
||||
char diff_buffer[BLOCKSIZE];
|
||||
|
||||
bytes_read = safe_read (file->fd, diff_buffer, rdsize);
|
||||
if (bytes_read == SAFE_READ_ERROR)
|
||||
{
|
||||
read_diag_details (file->stat_info->orig_file_name,
|
||||
- beg,
|
||||
- rdsize);
|
||||
- return false;
|
||||
- }
|
||||
- if (!zero_block_p (diff_buffer, bytes_read))
|
||||
- {
|
||||
- char begbuf[INT_BUFSIZE_BOUND (off_t)];
|
||||
- report_difference (file->stat_info,
|
||||
- _("File fragment at %s is not a hole"),
|
||||
- offtostr (beg, begbuf));
|
||||
+ offset, rdsize);
|
||||
return false;
|
||||
}
|
||||
|
||||
- beg += bytes_read;
|
||||
+ if (bytes_read == 0
|
||||
+ || !zero_block_p (diff_buffer, bytes_read))
|
||||
+ {
|
||||
+ char begbuf[INT_BUFSIZE_BOUND (off_t)];
|
||||
+ const char *msg = bytes_read ? _("File fragment at %s is not a hole")
|
||||
+ : _("Hole starting at %s is truncated");
|
||||
+
|
||||
+ report_difference (file->stat_info, msg, offtostr (beg, begbuf));
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ offset += bytes_read;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -542,7 +557,8 @@ check_data_region (struct tar_sparse_file *file, size_t i)
|
||||
file->dumped_size += bytes_read;
|
||||
size_left -= bytes_read;
|
||||
mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
|
||||
- if (memcmp (blk->buffer, diff_buffer, rdsize))
|
||||
+ if (bytes_read == 0
|
||||
+ || memcmp (blk->buffer, diff_buffer, bytes_read))
|
||||
{
|
||||
report_difference (file->stat_info, _("Contents differ"));
|
||||
return false;
|
||||
--
|
||||
1.9.3
|
||||
|
@ -0,0 +1,82 @@
|
||||
# This test is failing due to BZ#2066320 and BZ#1926332
|
||||
# So we decided to remove it from testsuite
|
||||
|
||||
--- tar-1.30/tests/Makefile.am.old 2022-12-05 10:18:29.093200490 +0000
|
||||
+++ tar-1.30/tests/Makefile.am 2022-12-05 10:18:47.058200490 +0000
|
||||
@@ -261,8 +261,7 @@ TESTSUITE_AT = \
|
||||
acls02.at\
|
||||
acls03.at\
|
||||
selnx01.at\
|
||||
- selacl01.at\
|
||||
- capabs_raw01.at
|
||||
+ selacl01.at
|
||||
|
||||
distclean-local:
|
||||
-rm -rf download
|
||||
--- tar-1.30/tests/testsuite.at.old 2022-12-05 10:19:51.023200490 +0000
|
||||
+++ tar-1.30/tests/testsuite.at 2022-12-05 10:20:19.418200490 +0000
|
||||
@@ -469,8 +469,6 @@ m4_include([acls03.at])
|
||||
m4_include([selnx01.at])
|
||||
m4_include([selacl01.at])
|
||||
|
||||
-m4_include([capabs_raw01.at])
|
||||
-
|
||||
AT_BANNER([One top level])
|
||||
m4_include([onetop01.at])
|
||||
m4_include([onetop02.at])
|
||||
--- tar-1.30-test/tests/capabs_raw01.at 2017-01-02 12:43:50.000000000 +0000
|
||||
+++ tar-1.30/tests/capabs_raw01.at 1970-01-01 00:00:00.000000000 +0000
|
||||
@@ -1,53 +0,0 @@
|
||||
-# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
-#
|
||||
-# Test suite for GNU tar.
|
||||
-# Copyright 2012-2014, 2016-2017 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 description: Test if file capabilities are archived/restored correctly
|
||||
-# using just the default xattr support (capabilities are stored/restored in
|
||||
-# binary format -> system dependant).
|
||||
-
|
||||
-AT_SETUP([capabilities: binary store/restore])
|
||||
-AT_KEYWORDS([xattrs capabilities capabs_raw01])
|
||||
-
|
||||
-AT_TAR_CHECK([
|
||||
-AT_PRIVILEGED_PREREQ
|
||||
-AT_XATTRS_PREREQ
|
||||
-AT_CAPABILITIES_UTILS_PREREQ
|
||||
-
|
||||
-mkdir dir
|
||||
-genfile --file dir/file
|
||||
-
|
||||
-setcap "= cap_chown=ei" dir/file
|
||||
-
|
||||
-# archive whole directory including binary xattrs
|
||||
-tar --xattrs -cf archive.tar dir
|
||||
-
|
||||
-# clear the directory
|
||||
-rm -rf dir
|
||||
-
|
||||
-# restore _all_ xattrs (not just the user.* domain)
|
||||
-tar --xattrs --xattrs-include='*' -xf archive.tar
|
||||
-
|
||||
-getcap dir/file
|
||||
-],
|
||||
-[0],
|
||||
-[dir/file = cap_chown+ei
|
||||
-])
|
||||
-
|
||||
-AT_CLEANUP
|
@ -0,0 +1,15 @@
|
||||
Per https://www.mail-archive.com/bug-tar@gnu.org/msg05440.html
|
||||
|
||||
diff --git a/tests/difflink.at b/tests/difflink.at
|
||||
index eadfb08..4e01176 100644
|
||||
--- a/tests/difflink.at
|
||||
+++ b/tests/difflink.at
|
||||
@@ -21,7 +21,7 @@ mkdir a
|
||||
genfile -f a/x
|
||||
ln -s x a/y
|
||||
ln a/y a/z
|
||||
-tar cf a.tar a
|
||||
+tar cf a.tar a/x a/y a/z
|
||||
rm a/z
|
||||
ln -s x a/z
|
||||
tar df a.tar
|
@ -0,0 +1,93 @@
|
||||
From 298cfc4743b9cca6cc0c685b9fce5b34827bec1b Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Raiskup <praiskup@redhat.com>
|
||||
Date: Thu, 4 Jan 2018 18:21:27 +0100
|
||||
Subject: [PATCH] tests: fix race in dirrem01 and dirrem02
|
||||
|
||||
Proposal:
|
||||
https://www.mail-archive.com/bug-tar@gnu.org/msg05451.html
|
||||
|
||||
Previously the '--checkpoint-action=echo' was triggered after
|
||||
'--checkpoint-action=sleep=1' - so the order of events *usually*
|
||||
was (for --format='gnu'):
|
||||
|
||||
...
|
||||
1. checkpoint handler before write of 'dir/sub' member
|
||||
2. one-second delay
|
||||
3. stderr write: 'tar: Write checkpoint 3'
|
||||
4. write the member 'dir/sub' into the archive
|
||||
5. check that the member's ctime has not been changed
|
||||
6. genfile's detecting 'Write checkpoint', doing unlink
|
||||
...
|
||||
|
||||
But sometimes, the genfile was fast enough to win the race and
|
||||
unlinked the directory before the member was written into the
|
||||
archive (IOW, the order was 1-2-3-6-4-5). This led to the
|
||||
occasional warning 'tar: dir/sub: file changed as we read it'.
|
||||
|
||||
Swap the order of 'sleep=1' and 'echo' actions so the genfile
|
||||
utility has (hopefully) enough time to do the unlink before
|
||||
writing the file into the archive (enforce 1-2-3-6-4-5 order).
|
||||
|
||||
* tests/dirrem01.at: Swap 'sleep=1' and 'echo' actions.
|
||||
* tests/dirrem02.at: Likewise.
|
||||
---
|
||||
tests/dirrem01.at | 5 +++--
|
||||
tests/dirrem02.at | 7 ++++---
|
||||
2 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tests/dirrem01.at b/tests/dirrem01.at
|
||||
index 40344dc..dabc206 100644
|
||||
--- a/tests/dirrem01.at
|
||||
+++ b/tests/dirrem01.at
|
||||
@@ -47,14 +47,15 @@ gnu) CPT=3;;
|
||||
esac
|
||||
|
||||
genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
|
||||
- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
|
||||
- --checkpoint-action='echo' -c -f archive.tar \
|
||||
+ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
|
||||
+ --checkpoint-action='sleep=1' -c -f archive.tar \
|
||||
--listed-incremental db -v dir >/dev/null
|
||||
],
|
||||
[1],
|
||||
[ignore],
|
||||
[tar: dir: Directory is new
|
||||
tar: dir/sub: Directory is new
|
||||
+tar: dir/sub: file changed as we read it
|
||||
tar: dir/sub: File removed before we read it
|
||||
],[],[],[gnu,posix])
|
||||
|
||||
diff --git a/tests/dirrem02.at b/tests/dirrem02.at
|
||||
index e1cf9ef..924454f 100644
|
||||
--- a/tests/dirrem02.at
|
||||
+++ b/tests/dirrem02.at
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
# Description:
|
||||
#
|
||||
-# When an explicitley named directory disappears during creation
|
||||
+# When an explicitly named directory disappears during creation
|
||||
# of incremental dump, tar should still exit with TAREXIT_FAILURE (2).
|
||||
#
|
||||
# For further details see dirrem01.at
|
||||
@@ -44,14 +44,15 @@ gnu) CPT=3;;
|
||||
esac
|
||||
|
||||
genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
|
||||
- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
|
||||
- --checkpoint-action='echo' -c -f archive.tar \
|
||||
+ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
|
||||
+ --checkpoint-action='sleep=1' -c -f archive.tar \
|
||||
--listed-incremental db -v dir dir/sub >/dev/null
|
||||
],
|
||||
[2],
|
||||
[ignore],
|
||||
[tar: dir: Directory is new
|
||||
tar: dir/sub: Directory is new
|
||||
+tar: dir/sub: file changed as we read it
|
||||
tar: dir/sub: Cannot open: No such file or directory
|
||||
tar: Exiting with failure status due to previous errors
|
||||
],[],[],[gnu,posix])
|
||||
--
|
||||
2.14.3
|
||||
|
@ -0,0 +1,50 @@
|
||||
From 60acf5a7407ef263aaf7d3751da08167b1990eb0 Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Poznyakoff <gray@gnu.org>
|
||||
Date: Wed, 20 May 2020 13:35:28 +0200
|
||||
Subject: [PATCH] Check return value from xgetcwd
|
||||
|
||||
* src/misc.c (chdir_arg,tar_getcdpath): Check for non-NULL
|
||||
return from xgetcwd. The function returns NULL for any
|
||||
error originating from getcwd.
|
||||
---
|
||||
src/misc.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/misc.c b/src/misc.c
|
||||
index cd07f53..eccf6f9 100644
|
||||
--- a/src/misc.c
|
||||
+++ b/src/misc.c
|
||||
@@ -301,8 +301,6 @@ normalize_filename (int cdidx, const char *name)
|
||||
size_t copylen;
|
||||
bool need_separator;
|
||||
|
||||
- if (!cdpath)
|
||||
- call_arg_fatal ("getcwd", ".");
|
||||
copylen = strlen (cdpath);
|
||||
need_separator = ! (DOUBLE_SLASH_IS_DISTINCT_ROOT
|
||||
&& copylen == 2 && ISSLASH (cdpath[1]));
|
||||
@@ -909,6 +907,8 @@ chdir_arg (char const *dir)
|
||||
{
|
||||
wd[wd_count].name = ".";
|
||||
wd[wd_count].abspath = xgetcwd ();
|
||||
+ if (!wd[wd_count].abspath)
|
||||
+ call_arg_fatal ("getcwd", ".");
|
||||
wd[wd_count].fd = AT_FDCWD;
|
||||
wd_count++;
|
||||
}
|
||||
@@ -1034,7 +1034,11 @@ tar_getcdpath (int idx)
|
||||
{
|
||||
static char *cwd;
|
||||
if (!cwd)
|
||||
- cwd = xgetcwd ();
|
||||
+ {
|
||||
+ cwd = xgetcwd ();
|
||||
+ if (!cwd)
|
||||
+ call_arg_fatal ("getcwd", ".");
|
||||
+ }
|
||||
return cwd;
|
||||
}
|
||||
return wd[idx].abspath;
|
||||
--
|
||||
2.24.1
|
||||
|
@ -0,0 +1,7 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.15 (GNU/Linux)
|
||||
|
||||
iEYEABECAAYFAlo2WDAACgkQNgKwf1XQxzLIAwCcCkJzqedt2FUq1N5ysPFomhvS
|
||||
SnIAnj+0Y7vNI1E4w/ektRMB/HTQceeK
|
||||
=TjVE
|
||||
-----END PGP SIGNATURE-----
|
@ -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
|
||||
|
@ -1,7 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1
|
||||
|
||||
iEYEABECAAYFAmAnuBMACgkQNgKwf1XQxzJIVgCfR5Z7coRkU2+aOW4KNhumGl/1
|
||||
jn4AoI9OuQPpyzZN1CIwejDYxbV7u59P
|
||||
=mfma
|
||||
-----END PGP SIGNATURE-----
|
Loading…
Reference in new issue