diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-08-17 05:55:18 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-08-17 05:55:18 +0000 |
commit | 1b992fb662acb7e68e9a25526c73178446b2d291 (patch) | |
tree | 3654313045b5bc014ac4e3c64d5bef994d8ff61d /rdiff-backup | |
parent | 3021c1ff874660b3238e901fef8425ff3eee1d7a (diff) | |
download | rdiff-backup-1b992fb662acb7e68e9a25526c73178446b2d291.tar.gz |
Further fix so we can restore backups with mirror_metadata files
missing intermediate directory
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@620 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup')
-rw-r--r-- | rdiff-backup/CHANGELOG | 10 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/rorpiter.py | 6 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/rpath.py | 5 |
3 files changed, 21 insertions, 0 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index d275d38..4684f54 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,3 +1,13 @@ +New in v1.0.1 (????/??/??) +-------------------------- + +Fix for "'filetype' of type exceptions.KeyError" error when restoring. +Test case provided by Davy Durham. (The problem was the +mirror_metadata file could become un-synced when a file is deleted +when rdiff-backup is running and later the directory that file is in +gets deleted.) + + New in v1.0.0 (2005/08/14) -------------------------- diff --git a/rdiff-backup/rdiff_backup/rorpiter.py b/rdiff-backup/rdiff_backup/rorpiter.py index 9bf75d4..88d5bcd 100644 --- a/rdiff-backup/rdiff_backup/rorpiter.py +++ b/rdiff-backup/rdiff_backup/rorpiter.py @@ -184,6 +184,12 @@ def FillInIter(rpiter, rootrp): for i in range(1, len(cur_index)): # i==0 case already handled if cur_index[:i] != old_index[:i]: filler_rp = rootrp.new_index(cur_index[:i]) + if not filler_rp.isdir(): + log.Log("Warning: expected %s to be a directory but " + "found %s instead.\nThis is probably caused " + "by a bug in versions 1.0.0 and earlier." % + (filler_rp.path, filler_rp.lstat()), 2) + filler_rp.make_zero_dir(rootrp) yield filler_rp yield rp old_index = cur_index diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 42ad5e9..05249ec 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -283,6 +283,11 @@ class RORPath: self.data = {'type': None} self.file = None + def make_zero_dir(self, dir_rp): + """Set self.data the same as dir_rp.data but with safe permissions""" + self.data = dir_rp.data.copy() + self.data['perms'] = 0700 + def __nonzero__(self): return 1 def __eq__(self, other): |