aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2016-08-02 08:10:07 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-02 11:15:18 +0000
commitc352b148106d2fdafa6e988db6d351f953a896ed (patch)
tree627b217d6e65f7b7164e3ab785706a48c4b99a3a /third_party
parentb0b33a76cd70930ed55c31e3d0ce4125676bd8c0 (diff)
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
Diffstat (limited to 'third_party')
-rw-r--r--third_party/ijar/zip_main.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/ijar/zip_main.cc b/third_party/ijar/zip_main.cc
index 68c226e9bd..05b6eca31e 100644
--- a/third_party/ijar/zip_main.cc
+++ b/third_party/ijar/zip_main.cc
@@ -143,9 +143,9 @@ void UnzipProcessor::Process(const char* filename, const u4 attr,
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) {