From 0d93f4f12c4c7d0a37dc2e6f792ce0f9dde793db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Sep 2015 21:49:05 -0400 Subject: Allow storing arbitrary ByteStrings in PrivData, extracted using privDataByteString. --- src/Propellor/Gpg.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Propellor/Gpg.hs') diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs index 86f84dc1..24743d40 100644 --- a/src/Propellor/Gpg.hs +++ b/src/Propellor/Gpg.hs @@ -14,6 +14,7 @@ import Utility.Process import Utility.Monad import Utility.Misc import Utility.Tmp +import Utility.FileSystemEncoding type KeyId = String @@ -112,8 +113,9 @@ gpgEncrypt f s = do , "--encrypt" , "--trust-model", "always" ] ++ concatMap (\k -> ["--recipient", k]) keyids - encrypted <- writeReadProcessEnv "gpg" opts - Nothing - (Just $ flip hPutStr s) - Nothing + encrypted <- writeReadProcessEnv "gpg" opts Nothing (Just writer) Nothing viaTmp writeFile f encrypted + where + writer h = do + fileEncoding h + hPutStr h s -- cgit v1.2.3