summaryrefslogtreecommitdiff
path: root/libarchive
diff options
context:
space:
mode:
authorZack Weger <ZWeger@StrozFriedberg.com>2018-10-08 11:17:10 -0400
committerJoel Uckelman <juckelman@strozfriedberg.co.uk>2022-06-01 11:51:59 +0100
commit2f0be17e48e848bc8eac4446ccd8a1b101e54e6e (patch)
treeecc3886d37cdbf928184f6d9ec684f66a37f52d7 /libarchive
parent60d790ff7f1455c9bd8cab1cf167014f6275a786 (diff)
downloadlibarchive-2f0be17e48e848bc8eac4446ccd8a1b101e54e6e.tar.gz
Files with invalid names don't exist, so don't set an error
Diffstat (limited to 'libarchive')
-rw-r--r--libarchive/archive_read_support_format_mtree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c
index 4a281632..3e797289 100644
--- a/libarchive/archive_read_support_format_mtree.c
+++ b/libarchive/archive_read_support_format_mtree.c
@@ -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);