summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-14 16:35:25 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-14 16:35:25 +0000
commita72819b38230bae86b8b222aa5c563aae8e2e730 (patch)
tree62f088003ccbe5baae16f3166d699154764cda71
parent94cf60f45cef946a0e24183e1890b3305134cdd8 (diff)
downloadrdiff-backup-a72819b38230bae86b8b222aa5c563aae8e2e730.tar.gz
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/trunk@894 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff_backup/increment.py21
2 files changed, 19 insertions, 6 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 537eb0c..a8b1f53 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
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)
diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py
index f1cdbc8..afab0d2 100644
--- a/rdiff-backup/rdiff_backup/increment.py
+++ b/rdiff-backup/rdiff_backup/increment.py
@@ -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
- old_new_perms = new.getperms()
- new.chmod(0400 | old_new_perms)
- Rdiff.write_delta(new, mirror, diff, compress)
- new.chmod(old_new_perms)
- else: Rdiff.write_delta(new, mirror, diff, compress)
+ 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)
+
+ 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