Merge pull request #297074 from lolbinarycat/tarfix

stdenv: pass --mode=+w to tar, ensuring extraction is possible
This commit is contained in:
Ryan Lahfa 2024-04-04 13:51:39 -07:00 committed by GitHub
commit 36cd37b5dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1069,12 +1069,12 @@ _defaultUnpack() {
# disregard the error code from the xz invocation. Otherwise,
# it can happen that tar exits earlier, causing xz to fail
# from a SIGPIPE.
(XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; true) | tar xf - --warning=no-timestamp
(XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; true) | tar xf - --mode=+w --warning=no-timestamp
;;
*.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
# GNU tar can automatically select the decompression method
# (info "(tar) gzip").
tar xf "$fn" --warning=no-timestamp
tar xf "$fn" --mode=+w --warning=no-timestamp
;;
*)
return 1