From 94da66c4015094e2c5a71e945ef3562644543c0f Mon Sep 17 00:00:00 2001 From: bescoto Date: Sat, 23 Aug 2003 23:42:57 +0000 Subject: Added tests for and fixed problem with backing up unreadable regular files as root on source and non-root on dest. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@399 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/increment.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'rdiff-backup/rdiff_backup/increment.py') diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py index 8d829e2..ea7a81d 100644 --- a/rdiff-backup/rdiff_backup/increment.py +++ b/rdiff-backup/rdiff_backup/increment.py @@ -79,7 +79,13 @@ def makediff(new, mirror, incpref): if compress: diff = get_inc(incpref, "diff.gz") else: diff = get_inc(incpref, "diff") - Rdiff.write_delta(new, mirror, diff, compress) + if Globals.process_uid != 0 and not new.readable(): + # Check for unreadable files + old_new_perms = new.getperms() + new.chmod(0400 | old_new_perms) + Rdiff.write_delta(new, mirror, diff, compress) + new.chmod(old_new_perms) + else: Rdiff.write_delta(new, mirror, diff, compress) rpath.copy_attribs(mirror, diff) return diff -- cgit v1.2.1