From 5fcbf6b06e1b457df58c8c30b78d38fb0eb86842 Mon Sep 17 00:00:00 2001 From: owsla Date: Mon, 28 Jan 2008 04:33:55 +0000 Subject: 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 --- rdiff-backup/CHANGELOG | 4 ++++ rdiff-backup/rdiff_backup/backup.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1