about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan Lahfa2024-04-04 13:51:39 -0700
committerGitHub2024-04-04 13:51:39 -0700
commit36cd37b5dcfa3e86133f9663c2deb0278bcdcd18 (patch)
treeef8d38388cae20422d5fd96979d0567d2b06aea2
parentf6827a0d19add123417b936f16202534135fbaa1 (diff)
parentf9094faf70fe5be3973bc8aa7d77d76d0acbe066 (diff)
Merge pull request #297074 from lolbinarycat/tarfix
stdenv: pass --mode=+w to tar, ensuring extraction is possible
-rw-r--r--pkgs/stdenv/generic/setup.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 9c918b12f96e..6c72395219f7 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -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