Commit 6212c1fd authored by owsla's avatar owsla

Make sticky bit warnings quieter during fs_abilities checks


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@1037 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent d483516c
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)
......
......@@ -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()
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment