From f9094faf70fe5be3973bc8aa7d77d76d0acbe066 Mon Sep 17 00:00:00 2001 From: binarycat Date: Mon, 18 Mar 2024 20:54:31 -0400 Subject: [PATCH] stdenv: pass --mode=+w to tar, ensuring extraction is possible fixes #191137 --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file 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