Windows: Added support for encrypted special remotes.
This commit is contained in:
parent
b28023cb52
commit
a837ed47f7
3 changed files with 20 additions and 11 deletions
|
@ -18,6 +18,9 @@ import System.Path
|
||||||
import Common
|
import Common
|
||||||
import Utility.Env
|
import Utility.Env
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified Build.SysConfig as SysConfig
|
||||||
|
#ifdef mingw32_HOST_OS
|
||||||
|
import Utility.Tmp
|
||||||
|
#endif
|
||||||
|
|
||||||
newtype KeyIds = KeyIds [String]
|
newtype KeyIds = KeyIds [String]
|
||||||
deriving (Ord, Eq)
|
deriving (Ord, Eq)
|
||||||
|
@ -77,8 +80,8 @@ pipeStrict params input = do
|
||||||
- Note that to avoid deadlock with the cleanup stage,
|
- Note that to avoid deadlock with the cleanup stage,
|
||||||
- the reader must fully consume gpg's input before returning. -}
|
- the reader must fully consume gpg's input before returning. -}
|
||||||
feedRead :: [CommandParam] -> String -> (Handle -> IO ()) -> (Handle -> IO a) -> IO a
|
feedRead :: [CommandParam] -> String -> (Handle -> IO ()) -> (Handle -> IO a) -> IO a
|
||||||
#ifndef mingw32_HOST_OS
|
|
||||||
feedRead params passphrase feeder reader = do
|
feedRead params passphrase feeder reader = do
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
-- pipe the passphrase into gpg on a fd
|
-- pipe the passphrase into gpg on a fd
|
||||||
(frompipe, topipe) <- createPipe
|
(frompipe, topipe) <- createPipe
|
||||||
void $ forkIO $ do
|
void $ forkIO $ do
|
||||||
|
@ -89,17 +92,23 @@ feedRead params passphrase feeder reader = do
|
||||||
let passphrasefd = [Param "--passphrase-fd", Param $ show pfd]
|
let passphrasefd = [Param "--passphrase-fd", Param $ show pfd]
|
||||||
|
|
||||||
params' <- stdParams $ [Param "--batch"] ++ passphrasefd ++ params
|
params' <- stdParams $ [Param "--batch"] ++ passphrasefd ++ params
|
||||||
closeFd frompipe `after`
|
closeFd frompipe `after` go params'
|
||||||
withBothHandles createProcessSuccess (proc gpgcmd params') go
|
|
||||||
where
|
|
||||||
go (to, from) = do
|
|
||||||
void $ forkIO $ do
|
|
||||||
feeder to
|
|
||||||
hClose to
|
|
||||||
reader from
|
|
||||||
#else
|
#else
|
||||||
feedRead = error "gpg feedRead not implemented on Windows" -- TODO
|
-- store the passphrase in a temp file for gpg
|
||||||
|
withTmpFile "gpg" $ \tmpfile h -> do
|
||||||
|
hPutStr h passphrase
|
||||||
|
hClose h
|
||||||
|
let passphrasefile = [Param "--passphrase-file", File tmpfile]
|
||||||
|
params' <- stdParams $ [Param "--batch"] ++ passphrasefile ++ params
|
||||||
|
go params'
|
||||||
#endif
|
#endif
|
||||||
|
where
|
||||||
|
go params' = withBothHandles createProcessSuccess (proc gpgcmd params')
|
||||||
|
$ \(to, from) -> do
|
||||||
|
void $ forkIO $ do
|
||||||
|
feeder to
|
||||||
|
hClose to
|
||||||
|
reader from
|
||||||
|
|
||||||
{- Finds gpg public keys matching some string. (Could be an email address,
|
{- Finds gpg public keys matching some string. (Could be an email address,
|
||||||
- a key id, or a name; See the section 'HOW TO SPECIFY A USER ID' of
|
- a key id, or a name; See the section 'HOW TO SPECIFY A USER ID' of
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -6,6 +6,7 @@ git-annex (4.20130803) UNRELEASED; urgency=low
|
||||||
* importfeed: Ignores transient problems with feeds. Only exits nonzero
|
* importfeed: Ignores transient problems with feeds. Only exits nonzero
|
||||||
when a feed has repeatedly had a problems for at least 1 day.
|
when a feed has repeatedly had a problems for at least 1 day.
|
||||||
* importfeed: Fix handling of dots in extensions.
|
* importfeed: Fix handling of dots in extensions.
|
||||||
|
* Windows: Added support for encrypted special remotes.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 02 Aug 2013 19:26:20 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 02 Aug 2013 19:26:20 -0400
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ now! --[[Joey]]
|
||||||
|
|
||||||
## status
|
## status
|
||||||
|
|
||||||
* Does not support encryption with gpg.
|
|
||||||
* Does not work with Cygwin's build of git (that git does not consistently
|
* Does not work with Cygwin's build of git (that git does not consistently
|
||||||
support use of DOS style paths, which git-annex uses on Windows).
|
support use of DOS style paths, which git-annex uses on Windows).
|
||||||
Must use the upstream build of git for Windows.
|
Must use the upstream build of git for Windows.
|
||||||
|
|
Loading…
Reference in a new issue