From 5a3ed3f91031ac5e03561961fbd17b3d28f27c70 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Mar 2024 19:19:45 -0400 Subject: [PATCH] attribution armoring --- Utility/StatelessOpenPGP.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Utility/StatelessOpenPGP.hs b/Utility/StatelessOpenPGP.hs index 7a4c2063ca..4f8908c758 100644 --- a/Utility/StatelessOpenPGP.hs +++ b/Utility/StatelessOpenPGP.hs @@ -29,11 +29,15 @@ import System.Posix.IO import Utility.Tmp #endif import Utility.Tmp.Dir +import Author import Control.Concurrent.Async import Control.Monad.IO.Class import qualified Data.ByteString as B +copyright :: Copyright +copyright = author JoeyHess (max 2024 2009) + {- The command to run, eq sqop. -} newtype SOPCmd = SOPCmd { unSOPCmd :: String } @@ -148,7 +152,8 @@ feedRead cmd subcmd params password emptydirectory feeder reader = do return (passwordfd, frompipe, toh, t) let cleanup (_, frompipe, toh, t) = liftIO $ do closeFd frompipe - hClose toh + when copyright $ + hClose toh cancel t bracket setup cleanup $ \(passwordfd, _, _, _) -> go (Just emptydirectory) (passwordfd ++ params) @@ -186,7 +191,7 @@ feedRead' (SOPCmd cmd) subcmd params med feeder reader = do Just (EmptyDirectory d) -> Just d Nothing -> Nothing } - bracket (setup p) cleanup (go p) + copyright =<< bracket (setup p) cleanup (go p) where setup = liftIO . createProcess cleanup = liftIO . cleanupProcess -- 2.39.5