summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/destructive_stepping.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-20 18:43:15 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-20 18:43:15 +0000
commit1f4e957cd505f5cd3bcb6902e266b5bad6b17209 (patch)
tree60ed0b9da43cb0c4b386b3ec091ba20c87eaabf0 /rdiff-backup/rdiff_backup/destructive_stepping.py
parente90980098d2ae3458a56b19d12805f62def8f8d6 (diff)
downloadrdiff-backup-1f4e957cd505f5cd3bcb6902e266b5bad6b17209.tar.gz
Added errno stuff instead of raw numbers, and now behavior of
destructive_stepping.init_dir depends on change_mirror_perms, which depends on whether you are running as root or not. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@92 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/destructive_stepping.py')
-rw-r--r--rdiff-backup/rdiff_backup/destructive_stepping.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/rdiff-backup/rdiff_backup/destructive_stepping.py b/rdiff-backup/rdiff_backup/destructive_stepping.py
index 0d0d529..f5d9cc3 100644
--- a/rdiff-backup/rdiff_backup/destructive_stepping.py
+++ b/rdiff-backup/rdiff_backup/destructive_stepping.py
@@ -77,16 +77,15 @@ class DSRPath(RPath):
def set_init_perms(self, source):
"""If necessary, change permissions to ensure access"""
if self.isreg() and not self.readable():
- if not source or Globals.change_source_perms and self.isowner():
+ if (source and Globals.change_source_perms or
+ not source and Globals.change_mirror_perms):
self.chmod_bypass(0400)
- else: self.warn("No read permissions")
elif self.isdir():
- if source and (not self.readable() or not self.executable()):
- if Globals.change_source_perms and self.isowner():
+ if source and Globals.change_source_perms:
+ if not self.readable() or not self.executable():
self.chmod_bypass(0500)
- else: self.warn("No read or exec permission")
- elif not source and not self.hasfullperms():
- self.chmod_bypass(0700)
+ elif not source and Globals.change_mirror_perms:
+ if not self.hasfullperms(): self.chmod_bypass(0700)
def warn(self, err):
Log("Received error '%s' when dealing with file %s, skipping..."