always add the specialRemoteConfigParsers

Was not being added in some places, resulting in error messages about
encryption not being a valid field.
This commit is contained in:
Joey Hess 2020-01-17 17:13:44 -04:00
parent 2a4731216d
commit 5c58f86790
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -177,9 +177,8 @@ externalSetup _ mu _ c gc = do
-- Now that we have an external, ask it to LISTCONFIGS,
-- and re-parse the RemoteConfig strictly, so we can
-- error out if the user provided an unexpected config.
p <- strictRemoteConfigParser external
let p' = addRemoteConfigParser specialRemoteConfigParsers p
_ <- either giveup return $ parseRemoteConfig c' p'
either giveup return . parseRemoteConfig c'
=<< strictRemoteConfigParser external
handleRequest external INITREMOTE Nothing $ \resp -> case resp of
INITREMOTE_SUCCESS -> result ()
INITREMOTE_FAILURE errmsg -> Just $ giveup errmsg
@ -785,13 +784,14 @@ getInfoM external = (++)
{- All unknown configs are passed through in case the external program
- uses them. -}
lenientRemoteConfigParser :: RemoteConfigParser
lenientRemoteConfigParser = RemoteConfigParser
{ remoteConfigFieldParsers =
[ optionalStringParser externaltypeField
, trueFalseParser readonlyField False
]
, remoteConfigRestPassthrough = const True
}
lenientRemoteConfigParser = addRemoteConfigParser specialRemoteConfigParsers $
RemoteConfigParser
{ remoteConfigFieldParsers =
[ optionalStringParser externaltypeField
, trueFalseParser readonlyField False
]
, remoteConfigRestPassthrough = const True
}
{- When the remote supports LISTCONFIGS, only accept the ones it listed.
- When it does not, accept all configs. -}