From 478eeea02e4305406ebf12246890088ff09443f1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Oct 2013 13:30:13 -0400 Subject: [PATCH] addurl: Better sanitization of generated filenames. Use sanitizeFilePath rather than rolling our own sanitizer. --- Command/AddUrl.hs | 4 ++-- debian/changelog | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 951bbdbe88..2379857dc6 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -223,6 +223,6 @@ url2file url pathdepth pathmax = case pathdepth of where fullurl = uriRegName auth ++ uriPath url ++ uriQuery url frombits a = intercalate "/" $ a urlbits - urlbits = map (truncateFilePath pathmax . escape) $ filter (not . null) $ split "/" fullurl + urlbits = map (truncateFilePath pathmax . sanitizeFilePath) $ + filter (not . null) $ split "/" fullurl auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url - escape = replace "/" "_" . replace "?" "_" diff --git a/debian/changelog b/debian/changelog index 3e51f56772..7582e3e233 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ git-annex (4.20131003) UNRELEASED; urgency=low * watcher: Detect at startup time when there is a stale .git/lock, and remove it so it does not interfere with the automatic commits of changed files. + * addurl: Better sanitization of generated filenames. -- Joey Hess Thu, 03 Oct 2013 15:41:24 -0400