Date: Mon, 27 Oct 2025 06:00:47 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 290556] tar(8) may strip symlink target when reading from cd9660 filesystem Message-ID: <bug-290556-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290556 Bug ID: 290556 Summary: tar(8) may strip symlink target when reading from cd9660 filesystem Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: markus@stoffdv.at PROBLEM When creating a tarball from files on _some_ cd9660 filesystems (e.g. created by xorrisofs(1)), all symbolic links will be stripped of their link target: Expected: lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-1 -> /some/fqfn lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-2 -> ../relpath lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-3 -> symlink-1 Found: lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-1 -> lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-2 -> lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-3 -> ANALYSIS Even if tar(1) drops the symlink target when reading from a cd9660 filesystem, it does extract them correctly from the device node or ISO image themselves. Note that this error does not occur when the ISO has been created with makefs(8): makefs -t cd9660 -o rockridge -o label=TARPIT /tmp/tarpit.iso /tmp/tarpit It does, however, occur when the image is created by xorrisofs(1): xorrisofs -rock -volid TARPIT -o /tmp/tarpit.iso /tmp/tarpit HOW TO REPRODUCE # We need xorrisofs(1) pkg install -y xorriso # Create ISO image with symlinks mkdir /tmp/tarpit ln -s /some/fqfn /tmp/tarpit/symlink-1 ln -s ../relpath /tmp/tarpit/symlink-2 ln -s symlink-1 /tmp/tarpit/symlink-3 xorrisofs -rock -volid TARPIT -o /tmp/tarpit.iso /tmp/tarpit # Mount ISO image dev=$(mdconfig /tmp/tarpit.iso) mount -t cd9660 /dev/iso9660/TARPIT # Validate filesystem contents ls -l /mnt # total 0 # lrwxr-xr-x 1 root wheel 0 27 Okt. 05:41 symlink-1 -> /some/fqfn # lrwxr-xr-x 1 root wheel 0 27 Okt. 05:41 symlink-2 -> ../relpath # lrwxr-xr-x 1 root wheel 0 27 Okt. 05:41 symlink-3 -> symlink-1 # Produces broken symlinks with the target component stripped away tar cf - -C /mnt . | tar tvf - # drwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./ # lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-1 -> # lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-2 -> # lrwxr-xr-x 0 root wheel 0 27 Okt. 05:41 ./symlink-3 -> # Produces intact symlinks (directly from ISO device or image) tar tvf /dev/iso9660/TARPIT tar tvf /tmp/tarpit.iso # drwxr-xr-x 2 0 0 2048 27 Okt. 05:41 . # lrwxr-xr-x 1 0 0 0 27 Okt. 05:41 symlink-1 -> /some/fqfn # lrwxr-xr-x 1 0 0 0 27 Okt. 05:41 symlink-2 -> ../relpath # lrwxr-xr-x 1 0 0 0 27 Okt. 05:41 symlink-3 -> symlink-1 # Cleanup umount /mnt mdconfig -d -u "${dev#md}" -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-290556-227>
