[Cmake-commits] CMake branch, next, updated. v3.8.0-rc3-590-gc4c307b
Kitware Robot
kwrobot at kitware.com
Mon Mar 27 17:05:02 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via c4c307b8259c39737019ddd1b7d7ce4b5cf89c15 (commit)
via 9dfccdc227f530997203ab9eb509a861f6718f59 (commit)
from c7df2fb6528c884ec69bedce2a4595997adc72ac (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4c307b8259c39737019ddd1b7d7ce4b5cf89c15
commit c4c307b8259c39737019ddd1b7d7ce4b5cf89c15
Merge: c7df2fb 9dfccdc
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 27 20:55:08 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Mar 27 16:55:11 2017 -0400
Stage topic 'libarchive-backport-zip-dir-fix'
Topic-id: 23311
Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/634
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9dfccdc227f530997203ab9eb509a861f6718f59
commit 9dfccdc227f530997203ab9eb509a861f6718f59
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 27 16:49:05 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 27 16:53:20 2017 -0400
libarchive: backport zip directory recognition fix
Backport upstream libarchive commit 2ecf8d1c1e (Try harder to detect
directories in zip archives, 2016-12-23).
Fixes: #16741
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
index c50ba84..8df52c3 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
@@ -850,29 +850,33 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
zip_entry->mode |= AE_IFREG;
}
- if ((zip_entry->mode & AE_IFMT) == 0) {
- /* Especially in streaming mode, we can end up
- here without having seen proper mode information.
- Guess from the filename. */
+ /* If the mode is totally empty, set some sane default. */
+ if (zip_entry->mode == 0) {
+ zip_entry->mode |= 0664;
+ }
+
+ /* Make sure that entries with a trailing '/' are marked as directories
+ * even if the External File Attributes contains bogus values. If this
+ * is not a directory and there is no type, assume regularfile. */
+ if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
+ int has_slash;
+
wp = archive_entry_pathname_w(entry);
if (wp != NULL) {
len = wcslen(wp);
- if (len > 0 && wp[len - 1] == L'/')
- zip_entry->mode |= AE_IFDIR;
- else
- zip_entry->mode |= AE_IFREG;
+ has_slash = len > 0 && wp[len - 1] == L'/';
} else {
cp = archive_entry_pathname(entry);
len = (cp != NULL)?strlen(cp):0;
- if (len > 0 && cp[len - 1] == '/')
- zip_entry->mode |= AE_IFDIR;
- else
- zip_entry->mode |= AE_IFREG;
+ has_slash = len > 0 && cp[len - 1] == '/';
}
- if (zip_entry->mode == AE_IFDIR) {
- zip_entry->mode |= 0775;
- } else if (zip_entry->mode == AE_IFREG) {
- zip_entry->mode |= 0664;
+ /* Correct file type as needed. */
+ if (has_slash) {
+ zip_entry->mode &= ~AE_IFMT;
+ zip_entry->mode |= AE_IFDIR;
+ zip_entry->mode |= 0111;
+ } else if ((zip_entry->mode & AE_IFMT) == 0) {
+ zip_entry->mode |= AE_IFREG;
}
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list