[Bug 257816] restore: cannot recreate hardlinks to absolute symlinks

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 13 Aug 2021 17:19:33 UTC

            Bug ID: 257816
           Summary: restore: cannot recreate hardlinks to absolute
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: mandree@FreeBSD.org
            Blocks: 252184

Created attachment 227165
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=227165&action=edit
demo script (needs privileges) to show how dump/restore or tar/libarchive fail
to faithfully recreate hardlinks-to-symlinks

affects FreeBSD 12.2 and 13.0

after a user reports against e2fsprogs, I conclude that restore(8) is broken
and cannot faithfully recreate a hardlink to a symbolic link.

tar(1) with libarchive(3) fails in a similar vain.

I am attaching a demo script that uses two 20M sized swap-based md(4) devices,
formats them with newfs -U and sets up some corner cases with symlinks 

### The error in question is, for dump/restore on 13.0:

warning: cannot create hard link
./usr/local/sbin/hardlink-to-abssymlink->./usr/local/sbin/abssymlink: No such
file or directory

mtree verification:
        link count (1, 2)
        link count (2, 1)
        link count (2, 1)
        type (link, file)
./usr/local/sbin/hardlink-to-abssymlink missing

and consequential differences shown with mtree.

### The error in question is, for tar (libarchive) on 13.0:

./usr/local/sbin/hardlink-to-abssymlink: Hard-link target
'./usr/local/sbin/abssymlink' does not exist.
./usr/local/sbin/hardlink-to-relsymlink: Hard-link target
'./usr/local/sbin/relsymlink' does not exist.

mtree verification:
.:      modification time (Fri Aug 13 19:12:46 2021, Fri Aug 13 19:12:47 2021)
./usr/local/sbin/abssymlink missing
./usr/local/sbin/hardlink-to-abssymlink missing
./usr/local/sbin/hardlink-to-relsymlink missing
./usr/local/sbin/relsymlink missing

### gtar from the gtar-1.34 (archivers/gtar) succeeds!

Referenced Bugs:

[Bug 252184] sysutils/e2fsprogs: checksum mismatch
You are receiving this mail because:
You are the assignee for the bug.