Double-clicking a ZIP archive assigns incorrect permissions to expanded files

Number:rdar://37460898 Date Originated:2018-02-12
Status:Duplicate/21212027 Resolved:2018-02-20
Product:macOS Product Version:10.13.3 (17D47)
Classification:Bug Reproducible:Always
# Summary:

After downloading a ZIP archive, the fastest and simplest way to expand it is to just double-click the file, which opens the Archive Utility application.

However, if the archive contains entries marked as made under MS-DOS (e.g. any ZIP archive generated by the git-archive utility), the execute bit is added to the expanded files.

This is very frustrating when the expanded file is a text file without a filename extension (e.g. LICENSE, README):
- The file is treated by macOS as an executable. Double-clicking it will open the Terminal instead of a text editor.
- If the archive was downloaded from the Internet (e.g., the file is also marked as quarantined.

This is also inconsistent with the behavior of the unzip command.

# Steps to Reproduce:

1. Open the Terminal.
2. Execute the following command:

    echo Hello World > README && zip -k README && rm README && open -a Finder .

3. A Finder window opens. Double-click the ZIP file in that window.
4. Archive Utility expands a "README" file in the current folder. Double-click that "README" file.

# Expected Results:

The "README" file should open in the TextEdit application.

# Actual Results:

A new Terminal window opens and tries to execute the "README" file.

# Version/Build:

macOS 10.13.3 (17D47)
Archive Utility 10.10 (81)


Let's hope it doesn't end like rdar://35197897.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!