summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/rpath.py
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-12-23 02:59:34 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-12-23 02:59:34 +0000
commit231fe19bbb7c2101db97eef60c28232b0e4e4875 (patch)
tree95099f2efbad07845d00fd1e4c915706b9bb9bae /rdiff-backup/rdiff_backup/rpath.py
parent44b6564c198e11c7da81430864214d68dc835442 (diff)
downloadrdiff-backup-231fe19bbb7c2101db97eef60c28232b0e4e4875.tar.gz
restore_set_root should check if it can read a directory before trying
to list the contents. Closes Savannah bug #21106 git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@854 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index d6f3655..03562e3 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -599,6 +599,10 @@ class RORPath:
"""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)