[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/Main.py rdi..
From: |
Andrew Ferguson |
Subject: |
[Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/Main.py rdi... |
Date: |
Mon, 24 Dec 2007 22:39:47 +0000 |
CVSROOT: /sources/rdiff-backup
Module name: rdiff-backup
Changes by: Andrew Ferguson <owsla> 07/12/24 22:39:47
Modified files:
. : CHANGELOG
rdiff_backup : Main.py backup.py rpath.py
Log message:
- Replace is_readable() function with pre-existing readable() function
- Close Savannah bug #21202 by not assuming that file cannot be opened
even if read permissions don't indicate such.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/CHANGELOG?cvsroot=rdiff-backup&r1=1.248&r2=1.249
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/Main.py?cvsroot=rdiff-backup&r1=1.113&r2=1.114
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/backup.py?cvsroot=rdiff-backup&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/rpath.py?cvsroot=rdiff-backup&r1=1.114&r2=1.115
Patches:
Index: CHANGELOG
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/CHANGELOG,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -b -r1.248 -r1.249
--- CHANGELOG 23 Dec 2007 02:59:34 -0000 1.248
+++ CHANGELOG 24 Dec 2007 22:39:47 -0000 1.249
@@ -1,6 +1,10 @@
New in v1.1.15 (????/??/??)
---------------------------
+Don't assume that a file cannot be read simply becasue of the access
+permissions -- eg, NFS with (rw,all_squash) options. Closes Savannah
+bug #21202. (Based on patch from Marc Horowitz)
+
restore_set_root should check if it can read a particular directory
before checking if "rdiff-backup-data" is contained in it. Closes
Savannah bug #21106. (Patch from Alex Chapman)
Index: rdiff_backup/Main.py
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/Main.py,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- rdiff_backup/Main.py 23 Dec 2007 02:59:34 -0000 1.113
+++ rdiff_backup/Main.py 24 Dec 2007 22:39:47 -0000 1.114
@@ -598,7 +598,7 @@
i = len(pathcomps)
while i >= min_len_pathcomps:
parent_dir = rpath.RPath(rpin.conn, "/".join(pathcomps[:i]))
- if (parent_dir.isdir() and parent_dir.is_readable() and
+ if (parent_dir.isdir() and parent_dir.readable() and
"rdiff-backup-data" in parent_dir.listdir()): break
if parent_dir.path == rpin.conn.Globals.get('restrict_path'):
return None
Index: rdiff_backup/backup.py
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/backup.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- rdiff_backup/backup.py 15 Jan 2006 03:07:56 -0000 1.40
+++ rdiff_backup/backup.py 24 Dec 2007 22:39:47 -0000 1.41
@@ -202,13 +202,20 @@
log.ErrorLog.write_if_open("UpdateError", dest_rp,
"File changed from regular file before
signature")
return None
- if Globals.process_uid != 0 and not dest_rp.readable():
+ if (Globals.process_uid != 0 and not dest_rp.readable() and
+ dest_rp.isowner()):
# This branch can happen with root source and non-root
# destination. Permissions are changed permanently,
which
# should propogate to the diffs
- assert dest_rp.isowner(), 'no ownership of %s' %
(dest_rp.path,)
dest_rp.chmod(0400 | dest_rp.getperms())
+ try:
return Rdiff.get_signature(dest_rp)
+ except IOError, e:
+ if (e.errno == errno.EPERM):
+ log.Log.FatalError("Could not open %s for
reading. Check "
+ "permissions on file." %
(dest_rp.path,))
+ else:
+ raise
def patch(cls, dest_rpath, source_diffiter, start_index = ()):
"""Patch dest_rpath with an rorpiter of diffs"""
Index: rdiff_backup/rpath.py
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/rpath.py,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- rdiff_backup/rpath.py 23 Dec 2007 02:59:34 -0000 1.114
+++ rdiff_backup/rpath.py 24 Dec 2007 22:39:47 -0000 1.115
@@ -599,10 +599,6 @@
"""Signal that rorp is a signature/diff for a hardlink file"""
self.data['linked'] = index
- def is_readable(self):
- """Check whether user can read the file or directory"""
- return self.conn.os.access(self.path, self.conn.os.R_OK)
-
def open(self, mode):
"""Return file type object if any was given using
self.setfile"""
if mode != "rb": raise RPathException("Bad mode %s" % mode)