Fix owner permissions bug in unzip code
This situation arises when a zip file does not contain entries for the
directories themselves, but only the files themselves.
--
MOS_MIGRATED_REVID=129072925
diff --git a/third_party/ijar/zip_main.cc b/third_party/ijar/zip_main.cc
index 68c226e..05b6eca 100644
--- a/third_party/ijar/zip_main.cc
+++ b/third_party/ijar/zip_main.cc
@@ -143,9 +143,9 @@
char path[PATH_MAX];
int fd;
concat_path(path, PATH_MAX, output_root_, filename);
- // Directories created must have executable bit set. Otherwise, we cannot
- // write or create any file inside.
- mkdirs(path, perm | S_IXUSR);
+ // Directories created must have executable bit set and be owner writeable.
+ // Otherwise, we cannot write or create any file inside.
+ mkdirs(path, perm | S_IWUSR | S_IXUSR);
if (!isdir) {
fd = open(path, O_CREAT | O_WRONLY, perm);
if (fd < 0) {