]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Files with invalid names don't exist, so don't set an error
authorZack Weger <ZWeger@StrozFriedberg.com>
Mon, 8 Oct 2018 15:17:10 +0000 (11:17 -0400)
committerJoel Uckelman <juckelman@strozfriedberg.co.uk>
Wed, 1 Jun 2022 10:51:59 +0000 (11:51 +0100)
libarchive/archive_read_support_format_mtree.c

index 4a2816325f225e3550e51676d4b4df5772bded9a..3e797289eed2ab6e4d216c3b7e7a78af242a6648 100644 (file)
@@ -1251,7 +1251,10 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
                        mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
                        __archive_ensure_cloexec_flag(mtree->fd);
                        if (mtree->fd == -1 &&
-                               (errno != ENOENT ||
+                            /* On Windows, attempting to open a file with an invalid name
+                             * result in EINVAL (Error 22)
+                             */
+                               ((errno != ENOENT && errno != EINVAL) ||
                                 archive_strlen(&mtree->contents_name) > 0)) {
                                archive_set_error(&a->archive, errno,
                                                "Can't open %s", path);