summaryrefslogtreecommitdiff
path: root/Command/GCryptSetup.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-02 20:15:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-02 20:15:40 -0400
commite5729ffd44bef0b19d81dba7523a72a92ab213e0 (patch)
tree305ae5899317312e98db1a7b708f9d6dae884882 /Command/GCryptSetup.hs
parent5d13546a3088559d570d5cd6fd55afc8b52a8a2c (diff)
Fix enabling of gcrypt repository accessed over ssh; git-annex-shell gcryptsetup had a bug that caused it to fail with permission denied.
Diffstat (limited to 'Command/GCryptSetup.hs')
-rw-r--r--Command/GCryptSetup.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Command/GCryptSetup.hs b/Command/GCryptSetup.hs
index a27e470c1..bdd770f15 100644
--- a/Command/GCryptSetup.hs
+++ b/Command/GCryptSetup.hs
@@ -23,13 +23,17 @@ seek = [withStrings start]
start :: String -> CommandStart
start gcryptid = next $ next $ do
- g <- gitRepo
u <- getUUID
+ when (u /= NoUUID) $
+ error "gcryptsetup refusing to run; this repository already has a git-annex uuid!"
+
+ g <- gitRepo
gu <- Remote.GCrypt.getGCryptUUID True g
- if u == NoUUID && gu == Nothing
+ let newgu = genUUIDInNameSpace gCryptNameSpace gcryptid
+ if gu == Nothing || gu == Just newgu
then if Git.repoIsLocalBare g
then do
void $ Remote.GCrypt.setupRepo gcryptid g
return True
else error "cannot use gcrypt in a non-bare repository"
- else error "gcryptsetup permission denied"
+ else error "gcryptsetup uuid mismatch"