Commit c153fdf7 authored by bescoto's avatar bescoto

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@620 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 58bee02d
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)
--------------------------
......
......@@ -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
......
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment