diff options
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r-- | rdiff-backup/rdiff_backup/Globals.py | 5 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 9 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/increment.py | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/Globals.py b/rdiff-backup/rdiff_backup/Globals.py index 8b63e8b..78176f2 100644 --- a/rdiff-backup/rdiff_backup/Globals.py +++ b/rdiff-backup/rdiff_backup/Globals.py @@ -200,6 +200,11 @@ compare_inode = 1 # guarantee that any changes have been committed to disk. fsync_directories = 1 +# If set, directory increments are given the same permissions as the +# directories they represent. Otherwise they have the default +# permissions. +change_dir_inc_perms = 1 + def get(name): """Return the value of something in this module""" diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index 2656712..40fca1c 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -56,8 +56,9 @@ def parse_cmdlineoptions(arglist): "include-globbing-filelist=", "include-regexp=", "list-at-time=", "list-changed-since=", "list-increments", "list-increment-sizes", "no-compare-inode", - "no-compression", "no-compression-regexp=", - "no-file-statistics", "no-hard-links", "null-separator", + "no-change-dir-inc-perms", "no-compression", + "no-compression-regexp=", "no-file-statistics", + "no-hard-links", "null-separator", "override-chars-to-quote=", "parsable-output", "print-statistics", "remote-cmd=", "remote-schema=", "remove-older-than=", "restore-as-of=", "restrict=", @@ -106,6 +107,8 @@ def parse_cmdlineoptions(arglist): elif opt == "-l" or opt == "--list-increments": action = "list-increments" elif opt == '--list-increment-sizes': action = 'list-increment-sizes' + elif opt == '--no-change-dir-inc-perms': + Globals.set('change_dir_inc_perms', 0) elif opt == "--no-compare-inode": Globals.set("compare_inode", 0) elif opt == "--no-compression": Globals.set("compression", None) elif opt == "--no-compression-regexp": @@ -617,6 +620,8 @@ def ListAtTime(rp): def CheckDest(dest_rp): """Check the destination directory, """ + if Globals.quoting_enabled: + dest_rp = FilenameMapping.get_quotedrpath(dest_rp) if Globals.rbdir is None: SetConnections.UpdateGlobal('rbdir', dest_rp.append_path("rdiff-backup-data")) diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py index f7fe5e7..8d829e2 100644 --- a/rdiff-backup/rdiff_backup/increment.py +++ b/rdiff-backup/rdiff_backup/increment.py @@ -87,9 +87,10 @@ def makedir(mirrordir, incpref): """Make file indicating directory mirrordir has changed""" dirsign = get_inc(incpref, "dir") dirsign.touch() - # Below, don't copy acls because directories can have more of them - # than ordinary files (they have default acls also). - rpath.copy_attribs(mirrordir, dirsign, acls = 0) + if Globals.change_dir_inc_perms: + # Below, don't copy acls because directories can have more of + # them than ordinary files (they have default acls also). + rpath.copy_attribs(mirrordir, dirsign, acls = 0) return dirsign def get_inc(rp, typestr, time = None): |