From 98e3817466130209d88d5061be9a590cdd609e78 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 16 Apr 2011 19:45:59 -0400 Subject: [PATCH] don't let users change encryption type once remote is initted --- Remote/Encrypted.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Remote/Encrypted.hs b/Remote/Encrypted.hs index 2a0fb13bca..0ff2833b37 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