Fix crash when exporttree is set to a bad value.

Made it impossible to recover from setting a bad value since enableremote
to change it would crash.

This commit was sponsored by Henrik Riomar on Patreon.
This commit is contained in:
Joey Hess 2018-10-10 10:44:54 -04:00
parent def5d8b02c
commit 6f0d8870df
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 1 deletions

View file

@ -14,6 +14,7 @@ git-annex (6.20180927) UNRELEASED; urgency=medium
when the same tree was exported by multiple clones.
* Fix potential crash in exporttree database due to failure to honor
uniqueness constraint.
* Fix crash when exporttree is set to a bad value.
-- Joey Hess <id@joeyh.name> Thu, 27 Sep 2018 15:27:20 -0400

View file

@ -75,7 +75,9 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
)
Nothing -> notexport
Just "no" -> notexport
Just _ -> error "bad exporttree value"
Just _ -> do
warning $ "bad exporttree value for " ++ name r ++ ", assuming not an export"
notexport
where
notexport = return $ r
{ exportActions = exportUnsupported