Merge pull request #105845 from lukegb/singleuser-fetchzip

fetchzip: get write permission on unpacked directory
This commit is contained in:
Benjamin Hipple 2020-12-05 06:52:07 -05:00 committed by GitHub
commit b65e82c7a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,8 +48,15 @@
+ extraPostFetch
# Remove write permissions for files unpacked with write bits set
# Fixes https://github.com/NixOS/nixpkgs/issues/38649
#
# However, we should (for the moment) retain write permission on the directory
# itself, to avoid tickling https://github.com/NixOS/nix/issues/4295 in
# single-user Nix installations. This is because in sandbox mode we'll try to
# move the path, and if we don't have write permissions on the directory,
# then we can't update the ".." entry.
+ ''
chmod -R a-w "$out"
chmod u+w "$out"
'';
} // removeAttrs args [ "stripRoot" "extraPostFetch" ])).overrideAttrs (x: {
# Hackety-hack: we actually need unzip hooks, too