dotnet / dotnet/msbuild

ZipDirectory on Linux/macOS produces zip with invalid file permissions on zip entries

Open
#3,924 3 comments 0 reactions 0 assignees View on GitHub
Area: Tasks bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 6h
Merged PRs (30d)
139

Description

The ZipDirectory task, when run on Linux or MacOS, produces an invalid .zip which cannot be used on Linux or macOS. The Unix file permissions on the zip entries contain permissions set to "0000", which means the files cannot be read, deleted, or executed.

### Steps to reproduce

Project file
```xml



```

Directory contents:
```
$ ls -l input/
total 0
-rwxr-xr-x 1 namc wheel 0 Nov 12 11:22 test.sh
-rw-r--r-- 1 namc wheel 0 Nov 12 11:22 test.txt
```

Command line
```
dotnet msbuild zip.proj
unzip stuff.zip -d extracted
ls -l extracted/
```

### Expected behavior
`` preserves Unix file permissions, or at the very least, set's a usable file permission like `rw-r--r--`

### Actual behavior
No permissions are preserved. The default, 0000, is used instead.
```
$ ls -l extracted/
total 0
---------- 1 namc wheel 0 Nov 12 11:22 test.sh
---------- 1 namc wheel 0 Nov 12 11:22 test.txt
```
### Environment data
`dotnet msbuild -version` output:
```
Microsoft (R) Build Engine version 15.9.19+g938f3292a0 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

15.9.19.36755
```
OS info: macOS Mojave

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.