mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
download: Use ungrafted tools in 'url-fetch/tarbomb' and 'url-fetch/zipbomb'.
Fixes <https://bugs.gnu.org/31085>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * guix/download.scm (url-fetch/tarbomb): Pass #:graft? #f to 'gexp->derivation'. (url-fetch/zipbomb): Likewise.
This commit is contained in:
parent
de7f03ce0a
commit
5e5d6613a3
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
|
;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
|
||||||
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
|
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
|
||||||
;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
|
;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
|
||||||
|
@ -509,6 +509,8 @@ (define tar
|
||||||
#:system system
|
#:system system
|
||||||
#:guile guile)))
|
#:guile guile)))
|
||||||
;; Take the tar bomb, and simply unpack it as a directory.
|
;; Take the tar bomb, and simply unpack it as a directory.
|
||||||
|
;; Use ungrafted tar/gzip so that the resulting tarball doesn't depend on
|
||||||
|
;; whether grafts are enabled.
|
||||||
(gexp->derivation (or name file-name)
|
(gexp->derivation (or name file-name)
|
||||||
#~(begin
|
#~(begin
|
||||||
(mkdir #$output)
|
(mkdir #$output)
|
||||||
|
@ -516,6 +518,7 @@ (define tar
|
||||||
(chdir #$output)
|
(chdir #$output)
|
||||||
(zero? (system* (string-append #$tar "/bin/tar")
|
(zero? (system* (string-append #$tar "/bin/tar")
|
||||||
"xf" #$drv)))
|
"xf" #$drv)))
|
||||||
|
#:graft? #f
|
||||||
#:local-build? #t)))
|
#:local-build? #t)))
|
||||||
|
|
||||||
(define* (url-fetch/zipbomb url hash-algo hash
|
(define* (url-fetch/zipbomb url hash-algo hash
|
||||||
|
@ -539,12 +542,15 @@ (define unzip
|
||||||
#:system system
|
#:system system
|
||||||
#:guile guile)))
|
#:guile guile)))
|
||||||
;; Take the zip bomb, and simply unpack it as a directory.
|
;; Take the zip bomb, and simply unpack it as a directory.
|
||||||
|
;; Use ungrafted unzip so that the resulting tarball doesn't depend on
|
||||||
|
;; whether grafts are enabled.
|
||||||
(gexp->derivation (or name file-name)
|
(gexp->derivation (or name file-name)
|
||||||
#~(begin
|
#~(begin
|
||||||
(mkdir #$output)
|
(mkdir #$output)
|
||||||
(chdir #$output)
|
(chdir #$output)
|
||||||
(zero? (system* (string-append #$unzip "/bin/unzip")
|
(zero? (system* (string-append #$unzip "/bin/unzip")
|
||||||
#$drv)))
|
#$drv)))
|
||||||
|
#:graft? #f
|
||||||
#:local-build? #t)))
|
#:local-build? #t)))
|
||||||
|
|
||||||
(define* (download-to-store store url #:optional (name (basename url))
|
(define* (download-to-store store url #:optional (name (basename url))
|
||||||
|
|
Loading…
Reference in a new issue