-RELEASE=4.1
-
-# Note: compile as root fail, so you need to do that as unpriv. user
-
-TARVER=1.27.1
+TARVER=1.29b
DEBREL=2
-PVETARVER=${TARVER}+pve.3
+PVETARVER=${TARVER}+pve.1
# also update changelog
dinstall: ${DEB}
dpkg -i ${DEB}
-.PHONY: deb
-deb ${DEB}: ${TARSRC}
+.PHONY: prepare
+prepare: $(TARDIR)
+$(TARDIR): $(TARSRC) $(TARDEBSRC)
rm -rf ${TARDIR}
tar xf ${TARSRC}
- cd ${TARDIR}; tar xf ../${TARDEBSRC}
+ tar -C $(TARDIR) -xf $(TARDEBSRC)
echo "${SOURCETXT}" > ${TARDIR}/debian/SOURCE
echo "debian/SOURCE" >>${TARDIR}/debian/docs
mv ${TARDIR}/debian/changelog ${TARDIR}/debian/changelog.org
cat changelog ${TARDIR}/debian/changelog.org >${TARDIR}/debian/changelog
- cd ${TARDIR}; patch -p1 <../acls-bugfix.patch
- cd ${TARDIR}; dpkg-buildpackage -b -uc -us
+ cd ${TARDIR} && patch -p1 -i ../sparse-unicode.patch
+
+.PHONY: deb
+deb: $(DEB)
+$(DEB): $(TARDIR)
+ cd ${TARDIR} && dpkg-buildpackage -b -uc -us
.PHONY: upload
-upload:
- umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
- mkdir -p /pve/${RELEASE}/extra
- rm -rf /pve/${RELEASE}/extra/tar_*.deb
- rm -rf /pve/${RELEASE}/extra/Packages*
- cp ${DEB} /pve/${RELEASE}/extra
- cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
- umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
+upload: $(DEB)
+ tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch
.PHONY: clean
clean:
- rm -rf *~ *_${ARCH}.deb *_all.deb *_${ARCH}.udeb *.changes *.dsc ${TARDIR}
+ rm -rf *~ *_${ARCH}.deb *_all.deb *_${ARCH}.udeb *.changes *.buildinfo *.dsc ${TARDIR}
-We recompile tar ourselfs to fix bug:
+We recompile tar ourselfs to fix bug #1467
+-> https://bugzilla.proxmox.com/show_bug.cgi?id=1467
+-> https://lists.gnu.org/archive/html/bug-tar/2016-06/msg00013.html
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819978
-
-See the acls-bugfix.patch headers for details
+See the sparse-unicode.patch file for details.
+++ /dev/null
-Description: Do not set default acls when --acls flag is used
-Origin: http://git.savannah.gnu.org/cgit/tar.git/commit/?id=7fe7adcbb985e78aaf9f78051fa26167779be1f6
-Forwarded: not-needed
-Author: Pavel Raiskup <praiskup@redhat.com>
-Bug-Upstream: http://www.mail-archive.com/bug-tar@gnu.org/msg04355.html
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819978
-Bug-PVE: https://bugzilla.proxmox.com/show_bug.cgi?id=928
-
-acls: bugfix for default ACLs extraction
-
- When --acls option is on (regardless of tarball contents or
- tarball format), we should explicitly set OR delete default ACLs
- for extracted directories. Prior to this update, we always
- created arbitrary default ACLs based standard file permissions.
-
- * configure.ac (with_posix_acls): Check also for acl_free and
- acl_delete_def_file to mark IEEE 1003.1e ACLs as supported.
- * src/xattrs.c (acl_delete_def_file_at): New function.
- (xattrs__acls_set): Do not treat acls_option at all; Delete
- default ACLs if appropriate.
-
- References:
- http://www.mail-archive.com/bug-tar@gnu.org/msg04355.html
- Thanks: Juan J. Martínez and Mark Steinborn
-
-diff --git a/configure.ac b/configure.ac
-index 08bed2b..d393876 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -74,7 +74,8 @@ AC_ARG_WITH([posix-acls],
- if test "x$with_posix_acls" != "xno"; then
- AC_CHECK_HEADERS(sys/acl.h,, [with_posix_acls=no])
- for tar_acl_func in acl_get_file acl_get_fd acl_set_file acl_set_fd \
-- acl_to_text acl_from_text; do \
-+ acl_to_text acl_from_text acl_delete_def_file \
-+ acl_free; do \
- test "x$with_posix_acls" = xno && break
- AC_SEARCH_LIBS([$tar_acl_func], [acl pacl], [], [with_posix_acls=no])
- done
-diff --git a/src/xattrs.c b/src/xattrs.c
-index dbaa209..307ee38 100644
---- a/src/xattrs.c
-+++ b/src/xattrs.c
-@@ -61,6 +61,7 @@ static struct
- static acl_t acl_get_file_at (int, const char *, acl_type_t);
- static int acl_set_file_at (int, const char *, acl_type_t, acl_t);
- static int file_has_acl_at (int, char const *, struct stat const *);
-+static int acl_delete_def_file_at (int, char const *);
-
- /* acl_get_file_at */
- #define AT_FUNC_NAME acl_get_file_at
-@@ -88,6 +89,17 @@ static int file_has_acl_at (int, char const *, struct stat const *);
- #undef AT_FUNC_POST_FILE_PARAM_DECLS
- #undef AT_FUNC_POST_FILE_ARGS
-
-+/* acl_delete_def_file_at */
-+#define AT_FUNC_NAME acl_delete_def_file_at
-+#define AT_FUNC_F1 acl_delete_def_file
-+#define AT_FUNC_POST_FILE_PARAM_DECLS
-+#define AT_FUNC_POST_FILE_ARGS
-+#include "at-func.c"
-+#undef AT_FUNC_NAME
-+#undef AT_FUNC_F1
-+#undef AT_FUNC_POST_FILE_PARAM_DECLS
-+#undef AT_FUNC_POST_FILE_ARGS
-+
- /* gnulib file_has_acl_at */
- #define AT_FUNC_NAME file_has_acl_at
- #define AT_FUNC_F1 file_has_acl
-@@ -187,7 +199,8 @@ fixup_extra_acl_fields (char *ptr)
- return ptr;
- }
-
--/* "system.posix_acl_access" */
-+/* Set the "system.posix_acl_access/system.posix_acl_default" extended
-+ attribute. Called only when acls_option > 0. */
- static void
- xattrs__acls_set (struct tar_stat_info const *st,
- char const *file_name, int type,
-@@ -199,15 +212,23 @@ xattrs__acls_set (struct tar_stat_info const *st,
- {
- /* assert (strlen (ptr) == len); */
- ptr = fixup_extra_acl_fields (ptr);
--
- acl = acl_from_text (ptr);
-- acls_option = 1;
- }
-- else if (acls_option > 0)
-- acl = perms2acl (st->stat.st_mode);
-+ else if (def)
-+ {
-+ /* No "default" IEEE 1003.1e ACL set for directory. At this moment,
-+ FILE_NAME may already have inherited default acls from parent
-+ directory; clean them up. */
-+ if (acl_delete_def_file_at (chdir_fd, file_name))
-+ WARNOPT (WARN_XATTR_WRITE,
-+ (0, errno,
-+ _("acl_delete_def_file_at: Cannot drop default POSIX ACLs "
-+ "for file '%s'"),
-+ file_name));
-+ return;
-+ }
- else
-- return; /* don't call acl functions unless we first hit an ACL, or
-- --acls was passed explicitly */
-+ acl = perms2acl (st->stat.st_mode);
-
- if (!acl)
- {
-tar (1.27.1+pve.3) unstable; urgency=medium
+tar (1.29b-2+pve.1) unstable; urgency=medium
- * Drop fix-sparse-archives.patch, it has been fixed in tar 1.27.1
- ( tar now tests with ST_IS_SPARSE() to avoids triggering the faulty code )
- * Add acls-bugfix.patch for Proxmox VE bug #928
+ * Update to debian's 1.29b-2
+ * Add sparse-unicode.patch to fix issues with unicode, sparse and zfs
+ compression.
- -- Proxmox Support Team <support@proxmox.com> Tue, 19 Apr 2016 10:14:22 +0200
-
-tar (1.27.1+pve.2) unstable; urgency=medium
-
- * Debian bug #737226 is still open and not even answered. So we
- need to compile our own package for debian jessie.
-
- -- Proxmox Support Team <support@proxmox.com> Sat, 04 Apr 2015 11:01:16 +0200
-
-tar (1.27.1+pve.1) unstable; urgency=low
-
- * fix Debian bug #737226: tar --sparse silently corrupts files on
- filesystems where non-empty files may have zero blocks
-
- -- Proxmox Support Team <support@proxmox.com> Tue, 18 Feb 2014 06:57:44 +0100
+ -- Proxmox Support Team <support@proxmox.com> Mon, 02 Oct 2017 14:24:30 +0200
--- /dev/null
+From 00f928642f7f7f1e7154a47df9cbf37ae70402ea Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Thu, 30 Jun 2016 16:17:29 +0200
+Subject: [PATCH] sparse: fix pax extraction for unicode filenames
+
+Make sure that 'GNU.sparse.name' header has higher priority than
+(for sparse-purposes artificially modified) 'path' pax header.
+
+Historically, the 'GNU.sparse.name' header comes before 'path';
+this caused that modified 'path' header won and that is not what
+we want in sparse "capable" tar implementation.
+
+* src/tar.h (tar_stat_info): New argument sparse_name_done.
+* src/xheader.c (raw_path_decoder): Move here the unconditional
+code from path_decoder.
+(path_decoder): Apply raw_path_decoder only if sparse_path_decoder
+was not yet called.
+(sparse_path_decoder): New wrapper around raw_path_decoder.
+* tests/sparse07.at: New testcase.
+* tests/testsuite.at: Mention new testcase.
+* tests/Makefile.am: Likewise.
+---
+ src/tar.h | 4 ++++
+ src/xheader.c | 26 ++++++++++++++++++++++----
+ tests/Makefile.am | 1 +
+ tests/sparse07.at | 35 +++++++++++++++++++++++++++++++++++
+ tests/testsuite.at | 1 +
+ 5 files changed, 63 insertions(+), 4 deletions(-)
+ create mode 100644 tests/sparse07.at
+
+diff --git a/src/tar.h b/src/tar.h
+index 07b5bc1..f3e2c43 100644
+--- a/src/tar.h
++++ b/src/tar.h
+@@ -331,6 +331,10 @@ struct tar_stat_info
+ int real_size_set; /* True when GNU.sparse.realsize is set in
+ archived file */
+
++ bool sparse_name_done; /* Set to true if 'GNU.sparse.name' header was
++ processed pax header parsing. Following 'path'
++ header (lower priority) will be ignored. */
++
+ size_t xattr_map_size; /* Size of the xattr map */
+ struct xattr_array *xattr_map;
+
+diff --git a/src/xheader.c b/src/xheader.c
+index 8dda580..335ddaf 100644
+--- a/src/xheader.c
++++ b/src/xheader.c
+@@ -1291,14 +1291,32 @@ path_coder (struct tar_stat_info const *st, char const *keyword,
+ }
+
+ static void
++raw_path_decoder (struct tar_stat_info *st, char const *arg)
++{
++ decode_string (&st->orig_file_name, arg);
++ decode_string (&st->file_name, arg);
++ st->had_trailing_slash = strip_trailing_slashes (st->file_name);
++}
++
++
++static void
+ path_decoder (struct tar_stat_info *st,
+ char const *keyword __attribute__((unused)),
+ char const *arg,
+ size_t size __attribute__((unused)))
+ {
+- decode_string (&st->orig_file_name, arg);
+- decode_string (&st->file_name, arg);
+- st->had_trailing_slash = strip_trailing_slashes (st->file_name);
++ if (! st->sparse_name_done)
++ raw_path_decoder (st, arg);
++}
++
++static void
++sparse_path_decoder (struct tar_stat_info *st,
++ char const *keyword __attribute__((unused)),
++ char const *arg,
++ size_t size __attribute__((unused)))
++{
++ st->sparse_name_done = true;
++ raw_path_decoder (st, arg);
+ }
+
+ static void
+@@ -1730,7 +1748,7 @@ struct xhdr_tab const xhdr_tab[] = {
+ { "uname", uname_coder, uname_decoder, 0, false },
+
+ /* Sparse file handling */
+- { "GNU.sparse.name", path_coder, path_decoder,
++ { "GNU.sparse.name", path_coder, sparse_path_decoder,
+ XHDR_PROTECTED, false },
+ { "GNU.sparse.major", sparse_major_coder, sparse_major_decoder,
+ XHDR_PROTECTED, false },
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 06f2325..fd38cb4 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -215,6 +215,7 @@ TESTSUITE_AT = \
+ sparse04.at\
+ sparse05.at\
+ sparse06.at\
++ sparse07.at\
+ sparsemv.at\
+ sparsemvp.at\
+ spmvp00.at\
+diff --git a/tests/sparse07.at b/tests/sparse07.at
+new file mode 100644
+index 0000000..8191c00
+--- /dev/null
++++ b/tests/sparse07.at
+@@ -0,0 +1,35 @@
++# Process this file with autom4te to create testsuite. -*- Autotest -*-
++
++# Test suite for GNU tar.
++# Copyright 2016 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([sparse files with unicode names])
++AT_KEYWORDS([sparse sparse07 unicode])
++
++AT_TAR_CHECK([
++genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || AT_SKIP_TEST
++tar -c -f archive --sparse žluť || exit 1
++
++tar tf archive
++],
++[0],
++[\305\276lu\305\245
++],
++[],[],[],[posix, gnu, oldgnu])
++
++AT_CLEANUP
+diff --git a/tests/testsuite.at b/tests/testsuite.at
+index e0525a1..59ace0b 100644
+--- a/tests/testsuite.at
++++ b/tests/testsuite.at
+@@ -387,6 +387,7 @@ m4_include([sparse03.at])
+ m4_include([sparse04.at])
+ m4_include([sparse05.at])
+ m4_include([sparse06.at])
++m4_include([sparse07.at])
+ m4_include([sparsemv.at])
+ m4_include([spmvp00.at])
+ m4_include([spmvp01.at])
+--
+2.11.0
+