diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-05-20 18:43:15 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-05-20 18:43:15 +0000 |
commit | 1f4e957cd505f5cd3bcb6902e266b5bad6b17209 (patch) | |
tree | 60ed0b9da43cb0c4b386b3ec091ba20c87eaabf0 /rdiff-backup/src/destructive_stepping.py | |
parent | e90980098d2ae3458a56b19d12805f62def8f8d6 (diff) | |
download | rdiff-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/src/destructive_stepping.py')
-rw-r--r-- | rdiff-backup/src/destructive_stepping.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rdiff-backup/src/destructive_stepping.py b/rdiff-backup/src/destructive_stepping.py index 0d0d529..f5d9cc3 100644 --- a/rdiff-backup/src/destructive_stepping.py +++ b/rdiff-backup/src/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..." |