From 8926552b215c1c313b3017b0eb3b326f7ab25828 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Sat, 23 Dec 2023 15:56:58 +0100 Subject: [PATCH] Relax `tar` upper bound --- Cabal-tests/Cabal-tests.cabal | 2 +- cabal-install/cabal-install.cabal | 2 +- cabal-install/src/Distribution/Client/Tar.hs | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index c2e3047da04..19572b2d0d1 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -167,7 +167,7 @@ test-suite hackage-tests , clock >=0.8 && <0.9 , optparse-applicative >=0.13.2.0 && <0.19 , stm >=2.4.5.0 && <2.6 - , tar >=0.5.0.3 && <0.6 + , tar >=0.5.0.3 && <0.7 , tree-diff >=0.1 && <0.4 ghc-options: -Wall -rtsopts -threaded diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 3cb68deb661..52d5f08edaa 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -227,7 +227,7 @@ library process >= 1.2.3.0 && < 1.7, random >= 1.2 && < 1.3, stm >= 2.0 && < 2.6, - tar >= 0.5.0.3 && < 0.6, + tar >= 0.5.0.3 && < 0.7, time >= 1.5.0.1 && < 1.13, zlib >= 0.5.3 && < 0.7, hackage-security >= 0.6.2.0 && < 0.7, diff --git a/cabal-install/src/Distribution/Client/Tar.hs b/cabal-install/src/Distribution/Client/Tar.hs index 313821a6b1a..898ad8898a7 100644 --- a/cabal-install/src/Distribution/Client/Tar.hs +++ b/cabal-install/src/Distribution/Client/Tar.hs @@ -69,8 +69,12 @@ extractTarGzFile -- ^ Tarball -> IO () extractTarGzFile dir expected tar = - Tar.unpack dir - . Tar.checkTarbomb expected + Tar.unpackAndCheck + ( \x -> + SomeException <$> Tar.checkEntryTarbomb expected x + <|> SomeException <$> Tar.checkEntrySecurity x + ) + dir . Tar.read . GZipUtils.maybeDecompress =<< BS.readFile tar