summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-08-08 21:08:45 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-08-08 21:08:45 +0000
commit21f6acc8fd95078e8b09df1061e3797efab06782 (patch)
tree98fdad4a4a66095a80a5664f53eb913e6ef2fe62
parent5b19af553b06d634a7093e0a41c8472849a837e0 (diff)
downloadrdiff-backup-21f6acc8fd95078e8b09df1061e3797efab06782.tar.gz
Handle failed attempts to set the sticky bit
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@838 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py14
2 files changed, 17 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 1a87b7c..3b534e4 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
New in v1.1.13 (????/??/??)
---------------------------
+Gracefully handle situations where rdiff-backup tries to set the sticky
+bit on non-directory files on systems that don't support that action.
+Thanks to Jim Nasby for the bug report. (Andrew Ferguson)
+
Prevent the extended filenames / UTF-8 test from raising an exception
on broken CIFS configurations which transform some characters to '?'.
Problem reported by Luca Cappe. (Andrew Ferguson)
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index a28efaa..b6b7578 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -829,7 +829,19 @@ class RPath(RORPath):
def chmod(self, permissions):
"""Wrapper around os.chmod"""
- self.conn.os.chmod(self.path, permissions & Globals.permission_mask)
+ try:
+ self.conn.os.chmod(self.path, permissions & Globals.permission_mask)
+ except OSError, exc:
+ if exc[0] == errno.EFTYPE and not self.isdir():
+ # Some systems throw this error if try to set sticky bit
+ # on a non-directory. Remove sticky bit and try again.
+ log.Log("Unable to set permissions of %s to %o - trying again"
+ "without sticky bit (%o)" % (self.path, permissions,
+ permissions & 06777), 2)
+ self.conn.os.chmod(self.path, permissions
+ & 06777 & Globals.permission_mask)
+ else:
+ raise
self.data['perms'] = permissions
def settime(self, accesstime, modtime):