From 6f0d8870dfd76021adf6226bb4bbc578d48ecc01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 Oct 2018 10:44:54 -0400 Subject: [PATCH] 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. --- CHANGELOG | 1 + Remote/Helper/Export.hs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d6f1460cb7..bba8caa8f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Thu, 27 Sep 2018 15:27:20 -0400 diff --git a/Remote/Helper/Export.hs b/Remote/Helper/Export.hs index 0dabf5ff99..75de664f11 100644 --- a/Remote/Helper/Export.hs +++ b/Remote/Helper/Export.hs @@ -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