borg: Fix a bug that prevented importing keys of type URL and WORM
Keys stored on the filesystem are mangled by keyFile to avoid problem chars. So, that mangling has to be reversed when parsing files from a borg backup back to a key. The directory special remote also so mangles them. Some other special remotes do not; eg S3 just serializes the key -- but S3 object names are not limited to filesystem valid filenames anyway, so a S3 server must not map them directly to files in any case. It seems unlikely that a borg backup of some such special remote will get broken by this change. This commit was sponsored by Graham Spencer on Patreon.
This commit is contained in:
parent
537f9d9a11
commit
31eb5fddf3
5 changed files with 13 additions and 3 deletions
|
@ -260,7 +260,7 @@ getImported u = M.unions <$> (mapM go . exportedTreeishes =<< getExport u)
|
|||
mkcontents archivename ti = do
|
||||
let f = ThirdPartyPopulated.fromThirdPartyImportLocation $
|
||||
mkImportLocation $ getTopFilePath $ LsTree.file ti
|
||||
k <- deserializeKey' (P.takeFileName f)
|
||||
k <- fileKey (P.takeFileName f)
|
||||
return
|
||||
( genImportLocation archivename f
|
||||
,
|
||||
|
|
|
@ -50,7 +50,7 @@ importKey :: ImportLocation -> ContentIdentifier -> ByteSize -> MeterUpdate -> A
|
|||
importKey loc _cid sz _ = return $ importKey' loc sz
|
||||
|
||||
importKey' :: ImportLocation -> ByteSize -> Maybe Key
|
||||
importKey' loc sz = case deserializeKey' f of
|
||||
importKey' loc sz = case fileKey f of
|
||||
Just k
|
||||
-- Annex objects always are in a subdirectory with the same
|
||||
-- name as the filename. If this is not the case for the file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue