summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rdiff-backup/CHANGELOG10
-rw-r--r--rdiff-backup/rdiff_backup/rorpiter.py6
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py5
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):