aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-22 15:17:00 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-22 15:17:00 -0400
commitd54ea42de6cbd297d398d4e6f1d27f507a7de5d9 (patch)
treef7d7e9fdfb591912e76dc7e66b67930cb25b576a
parent3d75b37447fc4df623eab359a89ce2bdc82ca285 (diff)
vicfg: Avoid crashing on badly encoded config data.
-rw-r--r--Command/Vicfg.hs6
-rw-r--r--debian/changelog6
-rw-r--r--doc/bugs/git_annex_vicfg_fail_with_Buffer:_invalid_argument___40__invalid_character__41__.mdwn7
3 files changed, 15 insertions, 4 deletions
diff --git a/Command/Vicfg.hs b/Command/Vicfg.hs
index faa2d3f05..8fc10deb5 100644
--- a/Command/Vicfg.hs
+++ b/Command/Vicfg.hs
@@ -42,7 +42,7 @@ start = do
createAnnexDirectory $ parentDir f
cfg <- getCfg
descs <- uuidDescriptions
- liftIO $ writeFile f $ genCfg cfg descs
+ liftIO $ writeFileAnyEncoding f $ genCfg cfg descs
vicfg cfg f
stop
@@ -52,11 +52,11 @@ vicfg curcfg f = do
-- Allow EDITOR to be processed by the shell, so it can contain options.
unlessM (liftIO $ boolSystem "sh" [Param "-c", Param $ unwords [vi, shellEscape f]]) $
error $ vi ++ " exited nonzero; aborting"
- r <- parseCfg (defCfg curcfg) <$> liftIO (readFileStrict f)
+ r <- parseCfg (defCfg curcfg) <$> liftIO (readFileStrictAnyEncoding f)
liftIO $ nukeFile f
case r of
Left s -> do
- liftIO $ writeFile f s
+ liftIO $ writeFileAnyEncoding f s
vicfg curcfg f
Right newcfg -> setCfg curcfg newcfg
diff --git a/debian/changelog b/debian/changelog
index bb99cd375..63b2adf36 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+git-annex (5.20141220) UNRELEASED; urgency=medium
+
+ * vicfg: Avoid crashing on badly encoded config data.
+
+ -- Joey Hess <id@joeyh.name> Mon, 22 Dec 2014 15:16:38 -0400
+
git-annex (5.20141219) unstable; urgency=medium
* Webapp: When adding a new box.com remote, use the new style chunking.
diff --git a/doc/bugs/git_annex_vicfg_fail_with_Buffer:_invalid_argument___40__invalid_character__41__.mdwn b/doc/bugs/git_annex_vicfg_fail_with_Buffer:_invalid_argument___40__invalid_character__41__.mdwn
index 4101ee1dc..b74528bda 100644
--- a/doc/bugs/git_annex_vicfg_fail_with_Buffer:_invalid_argument___40__invalid_character__41__.mdwn
+++ b/doc/bugs/git_annex_vicfg_fail_with_Buffer:_invalid_argument___40__invalid_character__41__.mdwn
@@ -11,7 +11,10 @@ The problem does exit on all the clone of the repos.
### What steps will reproduce the problem?
-I don't know if the "è" in the directory name is linked to this. It seem also that the description of one of the repository has been incorrect (something like "toubib: ~/Biblioth⯁⯁⯁que calibre/" where the three ⯁ replace one incorrectly encoded char that was, since then, changed.
+I don't know if the "è" in the directory name is linked to this. It seem
+also that the description of one of the repository has been incorrect
+(something like "toubib: ~/Biblioth⯁⯁⯁que calibre/" where the three ⯁
+replace one incorrectly encoded char that was, since then, changed.
### What version of git-annex are you using? On what operating system?
@@ -27,3 +30,5 @@ I'm using the more uptodate version that are in Debian sid:
local repository version: 5
supported repository version: 5
upgrade supported from repository versions: 0 1 2 4
+
+> [[fixed|done]] --[[Joey]]