Paste number 152043: | Dealing with tar bombs |
Pasted by: | civodul |
When: | 7 years, 2 weeks ago |
Share: | Tweet this! | http://paste.lisp.org/+39BF |
Channel: | None |
Paste contents: |
(use-modules (guix download)
(guix monads)
(guix gexp))
(define* (broken-tarball-fetch url hash-algo hash
#:optional name
#:key (system (%current-system))
(guile (default-guile)))
(mlet %store-monad ((drv (url-fetch url hash-algo hash
(string-append "tarbomb-" name)
#:system system
#:guile guile)))
;; Take the tar bomb, and simply unpack it as a directory.
(gexp->derivation name
#~(begin
(mkdir #$output)
(setenv "PATH"
(string-append #$gzip "/bin"))
(chdir #$output)
(zero? (system* (string-append #$tar "/bin/tar")
"xf" #$drv))))))
This paste has no annotations.