Skip to content

fetchzip fails if the contents have permissions 000 #555542

Description

@voidlily

Previously in #136030, there was an issue where incorrect permissions in a zip file were not writable. The fix at the time was to do chmod -R +w on the unpacked files.

I've run into another case of this, where instead of the files just being unwritable, the permissions are 000.

repro

The following derivation fails with "cannot read directory: permission denied" due to the permissions inside the zip file, as mentioned above:

fetchzip {
  url = "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.2/BepInEx-Unity.IL2CPP-win-x64-6.0.0-pre.2.zip";
  hash = "sha256-Yk4af4YJL4cg+RAw/+l0im5OLnU4ujWor6tRxGyGDMw=";
  stripRoot = false;
}

more info

Build log excerpt:

unpacking source archive /build/BepInEx-Unity.IL2CPP-win-x64-6.0.0-pre.2.zip
chmod: cannot read directory '/build/unpack/dotnet': Permission denied
chmod: cannot read directory '/build/unpack/BepInEx': Permission denied

zipinfo output showing the contents of the zip file all have 000 permissions set on them

❯ zipinfo /tmp/BepInEx-Unity.IL2CPP-win-x64-6.0.0-pre.2.zip
Archive:  /tmp/BepInEx-Unity.IL2CPP-win-x64-6.0.0-pre.2.zip
Zip file size: 34146254 bytes, number of entries: 231
?---------  2.0 unx        0 b- stor 24-Aug-12 19:54 BepInEx/
?---------  2.0 unx        0 b- stor 24-Aug-12 19:54 dotnet/
?---------  2.0 unx        5 b- defN 24-Aug-12 19:54 .doorstop_version
?---------  2.0 unx     7914 b- defN 24-Aug-12 19:54 changelog.txt
?---------  2.0 unx     1881 b- defN 24-Aug-12 19:54 doorstop_config.ini
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: fetchFetchers (e.g. fetchgit, fetchsvn, ...)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions