summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Gharrity <gharrma@google.com>2024-04-25 11:37:31 -0700
committerMatthew Gharrity <gharrma@google.com>2024-04-25 11:48:31 -0700
commit8cdb8707fed60cfd8912b9de54f1b0ada0938171 (patch)
treef2ea3b161c40878773fe8bff00b20c43c405db00
parent09d5f689f4eeb3bc8ec9f5343248920a46ffd49d (diff)
downloadidea-mirror-goog-studio-main.tar.gz
Fix permissions for zip directory entriesmirror-goog-studio-main
Before: -rw-r--r-- After: drwxr-xr-x Bug: 337034517 Bug: 332776868 Bug: 328263925 Change-Id: If7b1844de1e343d9961691f21e8898bbe564001f
-rw-r--r--build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt b/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt
index 8bb684890cc6..f8a8aba12bb6 100644
--- a/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt
+++ b/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt
@@ -438,7 +438,9 @@ Android Studio: b/233762164 */ addDirEntry(dirName)
// file name length
buffer.putShort(headerOffset + 28, (name.size and 0xffff).toShort())
// external file attributes
- buffer.putInt(headerOffset + 38, 0x81a40000L.toInt())
+ val isDir = name.lastOrNull() == '/'.code.toByte()
+ val unixAttributes = if (isDir) 0x41ed0000L else 0x81a40000L
+ buffer.putInt(headerOffset + 38, unixAttributes.toInt())
// relative offset of local file header
buffer.putInt(headerOffset + 42, (offset and 0xffffffffL).toInt())
// file name