stdenv: pass --mode=+w to tar, ensuring extraction is possible

fixes #191137
This commit is contained in:
binarycat 2024-03-18 20:54:31 -04:00
parent e6bf74e26a
commit f9094faf70
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