Merge "Always call SetMode in soong_zip"
diff --git a/zip/zip.go b/zip/zip.go
index 84e974b..6e412c9 100644
--- a/zip/zip.go
+++ b/zip/zip.go
@@ -656,9 +656,11 @@
UncompressedSize64: uint64(fileSize),
}
+ mode := os.FileMode(0600)
if executable {
- header.SetMode(0700)
+ mode = 0700
}
+ header.SetMode(mode)
err = createParentDirs(dest, src)
if err != nil {
diff --git a/zip/zip_test.go b/zip/zip_test.go
index a37ae41..441dea3 100644
--- a/zip/zip_test.go
+++ b/zip/zip_test.go
@@ -62,7 +62,7 @@
Method: method,
CRC32: crc32.ChecksumIEEE(contents),
UncompressedSize64: uint64(len(contents)),
- ExternalAttrs: 0,
+ ExternalAttrs: (syscall.S_IFREG | 0600) << 16,
}
}