summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-01-28 04:33:55 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-01-28 04:33:55 +0000
commit5fcbf6b06e1b457df58c8c30b78d38fb0eb86842 (patch)
tree8518bb8d34c91cd1f88221b3d4793137c74c8306
parent3fe1b02f85de582618148be9752bd0db74ceae78 (diff)
downloadrdiff-backup-5fcbf6b06e1b457df58c8c30b78d38fb0eb86842.tar.gz
Try chmod'ing again if we can't open a file -- let's rdiff-backup work
better in some AFS and NFS installs. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@878 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff_backup/backup.py9
2 files changed, 12 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index baf131b..f37d28d 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
New in v1.1.16 (????/??/??)
---------------------------
+Don't give up right away if we can't open a file. Try chmod'ing it even
+if we aren't root or don't own it, since that can sometimes work on AFS
+and NFS. Closes Savannah bug #21202. (Andrew Ferguson)
+
Correctly handle updates to nested directories with unreadable permissions.
Thanks to John Goerzen for the bug report. Closes Debian bugs #389134 and
#411849. (Andrew Ferguson)
diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py
index e0c5eec..2f5c9e4 100644
--- a/rdiff-backup/rdiff_backup/backup.py
+++ b/rdiff-backup/rdiff_backup/backup.py
@@ -212,7 +212,14 @@ class DestinationStruct:
return Rdiff.get_signature(dest_rp)
except IOError, e:
if (e.errno == errno.EPERM):
- log.Log.FatalError("Could not open %s for reading. Check "
+ try:
+ # Try chmod'ing anyway -- This can work on NFS and AFS
+ # depending on the setup. We keep the if() statement
+ # above for performance reasons.
+ dest_rp.chmod(0400 | dest_rp.getperms())
+ return Rdiff.get_signature(dest_rp)
+ except (IOError, OSError):
+ log.Log.FatalError("Could not open %s for reading. Check "
"permissions on file." % (dest_rp.path,))
else:
raise