From: Dag-Erling Smørgrav Date: Wed, 24 Jun 2026 15:55:41 +0000 (+0200) Subject: archive_write_disk_posix: Symlinks can have AppleDouble data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04f2cbc98ce50ee1ea86801b6c40eac7f27bf2d0;p=thirdparty%2Flibarchive.git archive_write_disk_posix: Symlinks can have AppleDouble data --- diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 9a6098daf..a27e73188 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -4350,7 +4350,7 @@ copy_metadata(struct archive_write_disk *a, const char *metadata, * with at least a writing mode(O_RDWR or O_WRONLY). it * makes the data fork uncompressed. */ - dffd = open(datafork, 0); + dffd = open(datafork, O_SYMLINK); if (dffd == -1) { archive_set_error(&a->archive, errno, "Failed to open the data fork for metadata"); @@ -4459,7 +4459,9 @@ fixup_appledouble(struct archive_write_disk *a, const char *pathname) if (la_stat(datafork.s, &st) == -1) goto skip_appledouble; #endif - if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode)) + if (!S_ISREG(st.st_mode) && + !S_ISDIR(st.st_mode) && + !S_ISLNK(st.st_mode)) goto skip_appledouble; /*