To reproduce,
touch a
ln a b
./bsdtar -c -f warn-hard-links.tar a b
rm a b
./bsdtar -x -f warn-hard-links.tar b
should produce a warning message about failing to create 'b' because the
hard-link target 'a' does not exist. Previously, it did not give any hints
about why 'b' could not be created.
en = create_filesystem_object(a);
}
+ if ((en == ENOENT) && (archive_entry_hardlink(a->entry) != NULL)) {
+ archive_set_error(&a->archive, en,
+ "Hard-link target '%s' does not exist.",
+ archive_entry_hardlink(a->entry));
+ return (ARCHIVE_FAILED);
+ }
+
if ((en == EISDIR || en == EEXIST)
&& (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) {
/* If we're not overwriting, we're done. */