diff options
author | Joey Hess <joey@kitenet.net> | 2011-04-16 19:45:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-04-16 19:45:59 -0400 |
commit | 98e3817466130209d88d5061be9a590cdd609e78 (patch) | |
tree | 0a55e5c117af965ad7143a69813320eb6d310f87 /Remote | |
parent | d2e74efdb2e5b819d5c56f167291b006badd94cb (diff) |
don't let users change encryption type once remote is initted
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/Encrypted.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Remote/Encrypted.hs b/Remote/Encrypted.hs index 2a0fb13bc..0ff2833b3 100644 --- a/Remote/Encrypted.hs +++ b/Remote/Encrypted.hs @@ -23,7 +23,8 @@ encryptionSetup :: RemoteConfig -> Annex RemoteConfig encryptionSetup c = case (M.lookup "encryption" c, extractCipher c) of (Nothing, Nothing) -> error "Specify encryption=key or encryption=none" - (Just "none", _) -> return c + (Just "none", Nothing) -> return c + (Just "none", Just _) -> error "Cannot change encryption type of existing remote." (Nothing, Just _) -> return c (Just _, Nothing) -> use $ genCipher c (Just _, Just v) -> use $ updateCipher c v |