Bug#909451: pristine-tar: Be resilient in the face of hard links - simple patch?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug#909451: pristine-tar: Be resilient in the face of hard links - simple patch?

John Goerzen-3
Package: pristine-tar
Version: 1.38
Severity: normal

I have a use case that occurs on a filesystem where jdupes is used
periodically to hardlink together duplicate files.  The tree which
tarballs will be used from contains such duplicates that may be
hardlinked either before or after the delta is generated.  GNU tar, by
default, inserts special "link to" records for a the second and
subsequent occurence of a reference to the same inode number.  That
such files may be hardlinked post-delta generation would cause the
generated tarball to be unpredictable and therefore quite possibly
broken.

I believe the very simple fix would be to add --hard-dereference to
the list of tar options in recreatetarball_helper.  In the case that
hard links were present in the tarball, xdelta ought to simply remove
the extra data and no harm would be done.

Thanks,

John

-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pristine-tar depends on:
ii  libbz2-1.0  1.0.6-8.1
ii  libc6       2.24-11+deb9u3
ii  perl        5.24.1-3+deb9u4
ii  tar         1.29b-1.1
ii  xdelta      1.1.3-9.1+b1
ii  xdelta3     3.0.11-dfsg-1+b1
ii  zlib1g      1:1.2.8.dfsg-5

Versions of packages pristine-tar recommends:
ii  bzip2     1.0.6-8.1
ii  pbzip2    1.1.9-1+b1
ii  xz-utils  5.2.2-1.2+b1

pristine-tar suggests no packages.

-- no debconf information