From 4eef3e1fb705c386dce55e5401a67a70b599ec5b Mon Sep 17 00:00:00 2001 From: owsla Date: Sun, 8 Mar 2009 17:25:01 +0000 Subject: Make sticky bit warnings quieter during fs_abilities git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r1-2@1039 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/fs_abilities.py | 16 +++++++++------- rdiff-backup/rdiff_backup/rpath.py | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index ae6f475..9066c7e 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,6 +1,9 @@ New in v1.2.8 (????/??/??) --------------------------- +Make sticky bit warnings quieter while determining file system abilities. +Closes Savannah bug #25788. (Andrew Ferguson) + Fix situation where destination file cannot be opened because of an access error. Thanks to Dean Cording for the bug report. (Andrew Ferguson) diff --git a/rdiff-backup/rdiff_backup/fs_abilities.py b/rdiff-backup/rdiff_backup/fs_abilities.py index cd3fbd6..1e22318 100644 --- a/rdiff-backup/rdiff_backup/fs_abilities.py +++ b/rdiff-backup/rdiff_backup/fs_abilities.py @@ -451,15 +451,17 @@ class FSAbilities: """See if increments can have full permissions like a directory""" test_rp = rp.append('dir_inc_check') test_rp.touch() - try: test_rp.chmod(07777) + try: test_rp.chmod(07777, 4) except OSError: test_rp.delete() self.dir_inc_perms = 0 return test_rp.setdata() assert test_rp.isreg() - if test_rp.getperms() == 07777: self.dir_inc_perms = 1 - else: self.dir_inc_perms = 0 + if test_rp.getperms() == 07777 or test_rp.getperms() == 06777: + self.dir_inc_perms = 1 + else: + self.dir_inc_perms = 0 test_rp.delete() def set_carbonfile(self): @@ -527,10 +529,10 @@ class FSAbilities: tmpd_rp = dir_rp.append("high_perms_dir") tmpd_rp.touch() try: - tmpf_rp.chmod(07000) - tmpf_rp.chmod(07777) - tmpd_rp.chmod(07000) - tmpd_rp.chmod(07777) + tmpf_rp.chmod(07000, 4) + tmpf_rp.chmod(07777, 4) + tmpd_rp.chmod(07000, 4) + tmpd_rp.chmod(07777, 4) except (OSError, IOError): self.high_perms = 0 else: self.high_perms = 1 tmpf_rp.delete() diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 9bcdd2e..a22fb9f 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -921,7 +921,7 @@ class RPath(RORPath): "\nName: %s\nOld: %s --> New: %s\n" % \ (self.path, temptype, self.data['type']) - def chmod(self, permissions): + def chmod(self, permissions, loglevel = 2): """Wrapper around os.chmod""" try: self.conn.os.chmod(self.path, permissions & Globals.permission_mask) @@ -932,7 +932,7 @@ class RPath(RORPath): # on a non-directory. Remove sticky bit and try again. log.Log("Warning: Unable to set permissions of %s to %o - " "trying again without sticky bit (%o)" % (self.path, - permissions, permissions & 06777), 2) + permissions, permissions & 06777), loglevel) self.conn.os.chmod(self.path, permissions & 06777 & Globals.permission_mask) else: -- cgit v1.2.1