From: Gleb Fotengauer-Malinovskiy Date: Fri, 29 May 2020 10:12:29 +0000 (+0300) Subject: Fix writing of cpio archives containing hardlinks without file type X-Git-Tag: v3.5.0~34^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84b27e52eb87d5d38cce9410e76e92a9d81c0318;p=thirdparty%2Flibarchive.git Fix writing of cpio archives containing hardlinks without file type Fixes: https://github.com/libarchive/libarchive/issues/1386 --- diff --git a/libarchive/archive_write_set_format_cpio.c b/libarchive/archive_write_set_format_cpio.c index 729f9c775..465e4ed28 100644 --- a/libarchive/archive_write_set_format_cpio.c +++ b/libarchive/archive_write_set_format_cpio.c @@ -250,7 +250,7 @@ archive_write_cpio_header(struct archive_write *a, struct archive_entry *entry) const char *path; size_t len; - if (archive_entry_filetype(entry) == 0) { + if (archive_entry_filetype(entry) == 0 && archive_entry_hardlink(entry) == NULL) { archive_set_error(&a->archive, -1, "Filetype required"); return (ARCHIVE_FAILED); } diff --git a/libarchive/archive_write_set_format_cpio_newc.c b/libarchive/archive_write_set_format_cpio_newc.c index 172fda62f..f0f39809d 100644 --- a/libarchive/archive_write_set_format_cpio_newc.c +++ b/libarchive/archive_write_set_format_cpio_newc.c @@ -190,7 +190,7 @@ archive_write_newc_header(struct archive_write *a, struct archive_entry *entry) const char *path; size_t len; - if (archive_entry_filetype(entry) == 0) { + if (archive_entry_filetype(entry) == 0 && archive_entry_hardlink(entry) == NULL) { archive_set_error(&a->archive, -1, "Filetype required"); return (ARCHIVE_FAILED); }