Commit 3875f745 authored by owsla's avatar owsla

Fix another case where rdiff-backup fails because it has insufficient

permissions on a file it owns.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@894 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 1a8aa424
New in v1.1.16 (????/??/??)
---------------------------
Fix another case where rdiff-backup fails because it has insufficient
permissions on a file it owns. Thanks to Peter Schuller for the test
case. (Andrew Ferguson)
Don't abort if can't read extended attributes or ACL because the path is
considered bad by the EA/ACL subsystem; print a warning instead. Problem
reported by Farkas Levente. (Andrew Ferguson)
......
......@@ -79,13 +79,22 @@ def makediff(new, mirror, incpref):
if compress: diff = get_inc(incpref, "diff.gz")
else: diff = get_inc(incpref, "diff")
if Globals.process_uid != 0 and not new.readable():
old_new_perms, old_mirror_perms = (None, None)
if Globals.process_uid != 0:
# Check for unreadable files
if not new.readable():
old_new_perms = new.getperms()
new.chmod(0400 | old_new_perms)
if not mirror.readable():
old_mirror_perms = mirror.getperms()
mirror.chmod(0400 | old_mirror_perms)
Rdiff.write_delta(new, mirror, diff, compress)
new.chmod(old_new_perms)
else: Rdiff.write_delta(new, mirror, diff, compress)
if old_new_perms: new.chmod(old_new_perms)
if old_mirror_perms: mirror.chmod(old_mirror_perms)
rpath.copy_attribs_inc(mirror, diff)
return diff
......
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