From 21f6acc8fd95078e8b09df1061e3797efab06782 Mon Sep 17 00:00:00 2001 From: owsla Date: Wed, 8 Aug 2007 21:08:45 +0000 Subject: 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 --- rdiff-backup/CHANGELOG | 4 ++++ rdiff-backup/rdiff_backup/rpath.py | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'rdiff-backup') 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): -- cgit v1.2.1