summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordgaudet <dgaudet@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-01-29 17:13:07 +0000
committerdgaudet <dgaudet@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-01-29 17:13:07 +0000
commit33614933091e57237227f3467e7921877166ef14 (patch)
treebb66e292faa2838a33c192f0cd8e993175d19fa1
parent5a425b2aeda996d3142b6f4f7af0a597c9618d77 (diff)
downloadrdiff-backup-33614933091e57237227f3467e7921877166ef14.tar.gz
Cygwin generates EACCESS on fsync -- so accept it rather than dieing.
(Marc Dyksterhouse). git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@783 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py12
2 files changed, 11 insertions, 4 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 02f9c48..b5bb058 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.1.8 (????/??/??)
--------------------------
+Cygwin generates EACCESS on fsync -- so accept it rather than dieing.
+(Marc Dyksterhouse).
+
Add "FilenameMapping.set_init_quote_vals" security exception.
(Marc Dyksterhouse)
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 18b1184..a9b8c9d 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -495,7 +495,8 @@ class RORPath:
def getperms(self):
"""Return permission block of file"""
- return self.data['perms']
+ if self.data.has_key('perms'): return self.data['perms']
+ else: return 0
def getuname(self):
"""Return username that owns the file"""
@@ -934,11 +935,13 @@ class RPath(RORPath):
def isowner(self):
"""Return true if current process is owner of rp or root"""
uid = self.conn.os.getuid()
- return uid == 0 or uid == self.data['uid']
+ return uid == 0 or \
+ (self.data.has_key('uid') and uid == self.data['uid'])
def isgroup(self):
"""Return true if process has group of rp"""
- return self.data['gid'] in self.conn.Globals.get('process_groups')
+ return (self.data.has_key('gid') and \
+ self.data['gid'] in self.conn.Globals.get('process_groups'))
def delete(self):
"""Delete file at self.path. Recursively deletes directories."""
@@ -1154,7 +1157,8 @@ class RPath(RORPath):
os.close(fd)
except OSError, e:
if locals().has_key('fd'): os.close(fd)
- if e.errno != errno.EPERM or self.isdir(): raise
+ if (e.errno != errno.EPERM and e.errno != errno.EACCES) \
+ or self.isdir(): raise
# Maybe the system doesn't like read-only fsyncing.
# However, to open RDWR, we may need to alter permissions