Bugfix of --sparse option in --diff mode

This commit is contained in:
Ondrej Dubaj 2020-07-13 08:27:23 +02:00
parent 4d2c3f08a9
commit 64ee568701
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 1864e189c710414f2f837ddd6b9cf575a05846cd Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Mon, 13 Jul 2020 08:23:29 +0200
Subject: [PATCH] Bugfix --sparse --diff mode
---
src/sparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sparse.c b/src/sparse.c
index d642a46..ac78894 100644
--- a/src/sparse.c
+++ b/src/sparse.c
@@ -684,7 +684,7 @@ check_data_region (struct tar_sparse_file *file, size_t i)
}
size_left -= bytes_read;
mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
- if (memcmp (blk->buffer, diff_buffer, rdsize))
+ if (memcmp (blk->buffer, diff_buffer, bytes_read))
{
report_difference (file->stat_info, _("Contents differ"));
return false;
--
2.24.1

View File

@ -5,7 +5,7 @@ Summary: A GNU file archiving program
Name: tar Name: tar
Epoch: 2 Epoch: 2
Version: 1.32 Version: 1.32
Release: 4%{?dist} Release: 5%{?dist}
License: GPLv3+ License: GPLv3+
URL: http://www.gnu.org/software/tar/ URL: http://www.gnu.org/software/tar/
@ -19,6 +19,7 @@ Patch3: tar-1.29-wildcards.patch
Patch4: tar-1.28-atime-rofs.patch Patch4: tar-1.28-atime-rofs.patch
Patch9: tar-1.28-document-exclude-mistakes.patch Patch9: tar-1.28-document-exclude-mistakes.patch
Patch10: tar-1.32-testsuite-fix.patch Patch10: tar-1.32-testsuite-fix.patch
Patch11: tar-1.32-bugfix-sparse-diff-mode.patch
BuildRequires: gcc BuildRequires: gcc
BuildRequires: autoconf automake texinfo gettext libacl-devel BuildRequires: autoconf automake texinfo gettext libacl-devel
@ -113,6 +114,9 @@ make check || (
%changelog %changelog
* Mon Jul 13 2020 Ondrej Dubaj <odubaj@redhat.com> - 2:1.32-5
- Bugfix of --sparse option in --diff mode
* Wed Feb 05 2020 Than Ngo <than@redhat.com> - 2:1.32-4 * Wed Feb 05 2020 Than Ngo <than@redhat.com> - 2:1.32-4
- Skip the test if genfile is unable to create - Skip the test if genfile is unable to create