From a86983dc7a066e5a7bf0482e67ed937156db144e Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Fri, 3 Apr 2020 18:35:38 -0700 Subject: [PATCH] Use 0777 instead of FileInfo() for dirs. Golang's FileInfo() implementation recognizes FAT filesystem directories correctly, but doesn't actually add executable bits, which essentially makes them inaccessible. Use 0777 when we know we're dealing with directories. (This is a cherry-pick change.) Fixes: 153207404 Test: manually tested with an aar file with FAT permission bits. Change-Id: Ie9f5320bc44d24b2f9d54d4036bb1747456655bb Merged-In: Ie9f5320bc44d24b2f9d54d4036bb1747456655bb --- cmd/zipsync/zipsync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zipsync/zipsync.go b/cmd/zipsync/zipsync.go index a6023d3bf..294e5ef0a 100644 --- a/cmd/zipsync/zipsync.go +++ b/cmd/zipsync/zipsync.go @@ -115,7 +115,7 @@ func main() { filename := filepath.Join(*outputDir, name) if f.FileInfo().IsDir() { - must(os.MkdirAll(filename, f.FileInfo().Mode())) + must(os.MkdirAll(filename, 0777)) } else { must(os.MkdirAll(filepath.Dir(filename), 0777)) in, err := f.Open()