don't let users change encryption type once remote is initted
This commit is contained in:
parent
d2e74efdb2
commit
98e3817466
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue