Commit 025697ad authored by dgaudet's avatar dgaudet

Cygwin generates EACCESS on fsync -- so accept it rather than dieing.

(Marc Dyksterhouse).


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@783 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 6a42dde1
New in v1.1.8 (????/??/??) 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. Add "FilenameMapping.set_init_quote_vals" security exception.
(Marc Dyksterhouse) (Marc Dyksterhouse)
......
...@@ -495,7 +495,8 @@ class RORPath: ...@@ -495,7 +495,8 @@ class RORPath:
def getperms(self): def getperms(self):
"""Return permission block of file""" """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): def getuname(self):
"""Return username that owns the file""" """Return username that owns the file"""
...@@ -934,11 +935,13 @@ class RPath(RORPath): ...@@ -934,11 +935,13 @@ class RPath(RORPath):
def isowner(self): def isowner(self):
"""Return true if current process is owner of rp or root""" """Return true if current process is owner of rp or root"""
uid = self.conn.os.getuid() 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): def isgroup(self):
"""Return true if process has group of rp""" """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): def delete(self):
"""Delete file at self.path. Recursively deletes directories.""" """Delete file at self.path. Recursively deletes directories."""
...@@ -1154,7 +1157,8 @@ class RPath(RORPath): ...@@ -1154,7 +1157,8 @@ class RPath(RORPath):
os.close(fd) os.close(fd)
except OSError, e: except OSError, e:
if locals().has_key('fd'): os.close(fd) 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. # Maybe the system doesn't like read-only fsyncing.
# However, to open RDWR, we may need to alter permissions # However, to open RDWR, we may need to alter permissions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment