summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2009-03-08 17:20:17 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2009-03-08 17:20:17 +0000
commit7bc00b67004b68d81f2f49259569b4810838cc09 (patch)
treed6192ab920682ae285bf99c45b6248a8de1748ff
parente8c50d21537cd67ddb03e24e50ed7cfb00e705d9 (diff)
downloadrdiff-backup-7bc00b67004b68d81f2f49259569b4810838cc09.tar.gz
Make sticky bit warnings quieter during fs_abilities checks
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@1037 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/fs_abilities.py16
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py4
3 files changed, 14 insertions, 9 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 66eac84..59fe575 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.3.3 (????/??/??)
---------------------------
+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 32dcde2..40b2342 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 5a94a8b..5c37068 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: